use of org.hl7.fhir.r4.model.codesystems.AuditEntityType 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);
}
Aggregations