use of org.hl7.fhir.r4.model.AuditEvent in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeAuditEventAuditEventSourceComponent.
protected void composeAuditEventAuditEventSourceComponent(Complex parent, String parentType, String name, AuditEvent.AuditEventSourceComponent element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeBackboneElement(t, "source", name, element, index);
if (element.hasSiteElement())
composeString(t, "AuditEvent", "site", element.getSiteElement(), -1);
if (element.hasObserver())
composeReference(t, "AuditEvent", "observer", element.getObserver(), -1);
for (int i = 0; i < element.getType().size(); i++) composeCoding(t, "AuditEvent", "type", element.getType().get(i), i);
}
use of org.hl7.fhir.r4.model.AuditEvent in project org.hl7.fhir.core by hapifhir.
the class TurtleTests method test_auditevent_example_disclosure.
@Test
public void test_auditevent_example_disclosure() throws FileNotFoundException, IOException, Exception {
System.out.println("auditevent-example-disclosure.ttl");
new Turtle().parse(TextFile.fileToString("C:\\work\\org.hl7.fhir\\build\\publish\\auditevent-example-disclosure.ttl"));
}
use of org.hl7.fhir.r4.model.AuditEvent in project SORMAS-Project by hzi-braunschweig.
the class AuditLoggerEjb method logApplicationLifecycle.
private void logApplicationLifecycle(Coding subtype, String outcomeDesc) {
AuditEvent applicationStartAudit = new AuditEvent();
applicationStartAudit.setType(new Coding(VALUESET_AUDIT_EVENT_TYPE_HTML, "110100", "Application Activity"));
applicationStartAudit.setSubtype(Collections.singletonList(subtype));
applicationStartAudit.setAction(AuditEvent.AuditEventAction.E);
applicationStartAudit.setRecorded(Calendar.getInstance(TimeZone.getDefault()).getTime());
// success
applicationStartAudit.setOutcome(AuditEvent.AuditEventOutcome._0);
applicationStartAudit.setOutcomeDesc(outcomeDesc);
AuditEvent.AuditEventAgentComponent agent = new AuditEvent.AuditEventAgentComponent();
CodeableConcept codeableConcept = new CodeableConcept();
codeableConcept.addCoding(new Coding("https://www.hl7.org/fhir/valueset-participation-role-type.html", "110151", "Application Launcher"));
agent.setType(codeableConcept);
agent.setName("SYSTEM");
applicationStartAudit.addAgent(agent);
AuditEvent.AuditEventSourceComponent source = new AuditEvent.AuditEventSourceComponent();
source.setSite(auditSourceSite);
// Application Server
AuditSourceType auditSourceType = AuditSourceType._4;
source.addType(new Coding(auditSourceType.getSystem(), auditSourceType.toCode(), auditSourceType.getDisplay()));
applicationStartAudit.setSource(source);
AuditEvent.AuditEventEntityComponent entity = new AuditEvent.AuditEventEntityComponent();
entity.setWhat(new Reference("StartupShutdownService"));
// System Object
AuditEntityType entityType = AuditEntityType._2;
entity.setType(new Coding(entityType.getSystem(), entityType.toCode(), entityType.getDisplay()));
applicationStartAudit.addEntity(entity);
accept(applicationStartAudit);
}
use of org.hl7.fhir.r4.model.AuditEvent in project SORMAS-Project by hzi-braunschweig.
the class AuditLoggerEjb method logFailedRestLogin.
@Override
public void logFailedRestLogin(String caller, String method, String pathInfo) {
AuditEvent restLoginFail = new AuditEvent();
restLoginFail.setType(USER_AUTHENTICATION_CODING);
restLoginFail.addSubtype(LOGIN_CODING);
restLoginFail.setAction(AuditEvent.AuditEventAction.E);
restLoginFail.setRecorded(Calendar.getInstance(TimeZone.getDefault()).getTime());
restLoginFail.setOutcome(AuditEvent.AuditEventOutcome._4);
restLoginFail.setOutcomeDesc("Authentication failed");
AuditEvent.AuditEventAgentComponent agent = new AuditEvent.AuditEventAgentComponent();
agent.setName(caller);
restLoginFail.addAgent(agent);
AuditEvent.AuditEventSourceComponent source = new AuditEvent.AuditEventSourceComponent();
source.setSite(String.format("%s - REST MultiAuthenticationMechanism", auditSourceSite));
restLoginFail.setSource(source);
AuditEvent.AuditEventEntityComponent entity = new AuditEvent.AuditEventEntityComponent();
entity.setWhat(new Reference(String.format("%s %s", method, pathInfo)));
restLoginFail.addEntity(entity);
accept(restLoginFail);
}
use of org.hl7.fhir.r4.model.AuditEvent in project SORMAS-Project by hzi-braunschweig.
the class AuditLoggerEjb method logLabMessageError.
private void logLabMessageError(String messageUuid, Coding type, Reference what, String outcome, String error, Date start, Date end, String authAlias) {
AuditEvent logLabMessage = new AuditEvent();
logLabMessage.setType(type);
logLabMessage.setAction(AuditEvent.AuditEventAction.E);
makePeriod(start, end, logLabMessage);
logLabMessage.setRecorded(Calendar.getInstance(TimeZone.getDefault()).getTime());
logLabMessage.setOutcome(AuditEvent.AuditEventOutcome._8);
logLabMessage.setOutcomeDesc(outcome);
logLabMessage.addAgent(getAuditEventAgentComponentWithAuthAlias(authAlias));
AuditEvent.AuditEventSourceComponent source = new AuditEvent.AuditEventSourceComponent();
source.setSite(String.format("%s - DEMIS", auditSourceSite));
logLabMessage.setSource(source);
AuditEvent.AuditEventEntityComponent entity = new AuditEvent.AuditEventEntityComponent();
entity.setWhat(what);
AuditEvent.AuditEventEntityDetailComponent uuid = new AuditEvent.AuditEventEntityDetailComponent(new StringType("messageUuid"), new StringType(messageUuid));
entity.addDetail(uuid);
AuditEvent.AuditEventEntityDetailComponent errorMessage = new AuditEvent.AuditEventEntityDetailComponent(new StringType("errorMessage"), new StringType(error));
entity.addDetail(errorMessage);
logLabMessage.addEntity(entity);
accept(logLabMessage);
}
Aggregations