Search in sources :

Example 1 with AuditEntityType

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);
}
Also used : AuditSourceType(org.hl7.fhir.r4.model.codesystems.AuditSourceType) AuditEntityType(org.hl7.fhir.r4.model.codesystems.AuditEntityType) Coding(org.hl7.fhir.r4.model.Coding) Reference(org.hl7.fhir.r4.model.Reference) AuditEvent(org.hl7.fhir.r4.model.AuditEvent) CodeableConcept(org.hl7.fhir.r4.model.CodeableConcept)

Aggregations

AuditEvent (org.hl7.fhir.r4.model.AuditEvent)1 CodeableConcept (org.hl7.fhir.r4.model.CodeableConcept)1 Coding (org.hl7.fhir.r4.model.Coding)1 Reference (org.hl7.fhir.r4.model.Reference)1 AuditEntityType (org.hl7.fhir.r4.model.codesystems.AuditEntityType)1 AuditSourceType (org.hl7.fhir.r4.model.codesystems.AuditSourceType)1