Search in sources :

Example 1 with AuditEvent

use of org.hl7.fhir.dstu3.model.AuditEvent in project ipf by oehf.

the class AbstractFhirAuditSerializationStrategy method translate.

protected AuditEvent translate(AuditMessage auditMessage) {
    var eit = auditMessage.getEventIdentification();
    var auditEvent = new AuditEvent().setType(codedValueTypeToCoding(eit.getEventID())).setAction(getAuditEventAction(eit.getEventActionCode())).setRecorded(Date.from(eit.getEventDateTime())).setOutcome(getAuditEventOutcome(eit.getEventOutcomeIndicator())).setOutcomeDesc(eit.getEventOutcomeDescription());
    eit.getEventTypeCode().forEach(etc -> auditEvent.addSubtype(codedValueTypeToCoding(etc)));
    eit.getPurposesOfUse().forEach(pou -> auditEvent.addPurposeOfEvent(codedValueTypeToCodeableConcept(pou)));
    auditMessage.getActiveParticipants().forEach(ap -> auditEvent.addAgent(activeParticipantToAgent(ap)));
    auditEvent.setSource(auditSourceIdentificationToEventSource(auditMessage.getAuditSourceIdentification()));
    auditMessage.getParticipantObjectIdentifications().forEach(poit -> auditEvent.addEntity(participantObjectIdentificationToEntity(poit)));
    return auditEvent;
}
Also used : AuditEvent(org.hl7.fhir.dstu3.model.AuditEvent)

Example 2 with AuditEvent

use of org.hl7.fhir.dstu3.model.AuditEvent in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeAuditEventAuditEventAgentNetworkComponent.

protected void composeAuditEventAuditEventAgentNetworkComponent(Complex parent, String parentType, String name, AuditEvent.AuditEventAgentNetworkComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "network", name, element, index);
    if (element.hasAddressElement())
        composeString(t, "AuditEvent", "address", element.getAddressElement(), -1);
    if (element.hasTypeElement())
        composeEnum(t, "AuditEvent", "type", element.getTypeElement(), -1);
}
Also used : Complex(org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)

Example 3 with AuditEvent

use of org.hl7.fhir.dstu3.model.AuditEvent in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeAuditEventAuditEventEntityComponent.

protected void composeAuditEventAuditEventEntityComponent(Complex parent, String parentType, String name, AuditEvent.AuditEventEntityComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "entity", name, element, index);
    if (element.hasIdentifier())
        composeIdentifier(t, "AuditEvent", "identifier", element.getIdentifier(), -1);
    if (element.hasReference())
        composeReference(t, "AuditEvent", "reference", element.getReference(), -1);
    if (element.hasType())
        composeCoding(t, "AuditEvent", "type", element.getType(), -1);
    if (element.hasRole())
        composeCoding(t, "AuditEvent", "role", element.getRole(), -1);
    if (element.hasLifecycle())
        composeCoding(t, "AuditEvent", "lifecycle", element.getLifecycle(), -1);
    for (int i = 0; i < element.getSecurityLabel().size(); i++) composeCoding(t, "AuditEvent", "securityLabel", element.getSecurityLabel().get(i), i);
    if (element.hasNameElement())
        composeString(t, "AuditEvent", "name", element.getNameElement(), -1);
    if (element.hasDescriptionElement())
        composeString(t, "AuditEvent", "description", element.getDescriptionElement(), -1);
    if (element.hasQueryElement())
        composeBase64Binary(t, "AuditEvent", "query", element.getQueryElement(), -1);
    for (int i = 0; i < element.getDetail().size(); i++) composeAuditEventAuditEventEntityDetailComponent(t, "AuditEvent", "detail", element.getDetail().get(i), i);
}
Also used : Complex(org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)

Example 4 with AuditEvent

use of org.hl7.fhir.dstu3.model.AuditEvent in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeAuditEvent.

protected void composeAuditEvent(Complex parent, String parentType, String name, AuditEvent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeDomainResource(t, "AuditEvent", name, element, index);
    if (element.hasType())
        composeCoding(t, "AuditEvent", "type", element.getType(), -1);
    for (int i = 0; i < element.getSubtype().size(); i++) composeCoding(t, "AuditEvent", "subtype", element.getSubtype().get(i), i);
    if (element.hasActionElement())
        composeEnum(t, "AuditEvent", "action", element.getActionElement(), -1);
    if (element.hasRecordedElement())
        composeInstant(t, "AuditEvent", "recorded", element.getRecordedElement(), -1);
    if (element.hasOutcomeElement())
        composeEnum(t, "AuditEvent", "outcome", element.getOutcomeElement(), -1);
    if (element.hasOutcomeDescElement())
        composeString(t, "AuditEvent", "outcomeDesc", element.getOutcomeDescElement(), -1);
    for (int i = 0; i < element.getPurposeOfEvent().size(); i++) composeCodeableConcept(t, "AuditEvent", "purposeOfEvent", element.getPurposeOfEvent().get(i), i);
    for (int i = 0; i < element.getAgent().size(); i++) composeAuditEventAuditEventAgentComponent(t, "AuditEvent", "agent", element.getAgent().get(i), i);
    if (element.hasSource())
        composeAuditEventAuditEventSourceComponent(t, "AuditEvent", "source", element.getSource(), -1);
    for (int i = 0; i < element.getEntity().size(); i++) composeAuditEventAuditEventEntityComponent(t, "AuditEvent", "entity", element.getEntity().get(i), i);
}
Also used : Complex(org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)

Example 5 with AuditEvent

use of org.hl7.fhir.dstu3.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.hasIdentifier())
        composeIdentifier(t, "AuditEvent", "identifier", element.getIdentifier(), -1);
    for (int i = 0; i < element.getType().size(); i++) composeCoding(t, "AuditEvent", "type", element.getType().get(i), i);
}
Also used : Complex(org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)

Aggregations

AuditEvent (org.hl7.fhir.r4.model.AuditEvent)10 Complex (org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)6 Complex (org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)6 Complex (org.hl7.fhir.r4.utils.formats.Turtle.Complex)6 Reference (org.hl7.fhir.r4.model.Reference)5 Coding (org.hl7.fhir.r4.model.Coding)4 AuditSourceType (org.hl7.fhir.r4.model.codesystems.AuditSourceType)3 Test (org.junit.jupiter.api.Test)3 MethodOutcome (ca.uhn.fhir.rest.api.MethodOutcome)2 Date (java.util.Date)2 Turtle (org.hl7.fhir.dstu3.utils.formats.Turtle)2 CodeableConcept (org.hl7.fhir.r4.model.CodeableConcept)2 StringType (org.hl7.fhir.r4.model.StringType)2 RequestDetails (ca.uhn.fhir.rest.api.server.RequestDetails)1 ArrayList (java.util.ArrayList)1 AuditEvent (org.hl7.fhir.dstu3.model.AuditEvent)1 Bundle (org.hl7.fhir.r4.model.Bundle)1 Identifier (org.hl7.fhir.r4.model.Identifier)1 InstantType (org.hl7.fhir.r4.model.InstantType)1 Period (org.hl7.fhir.r4.model.Period)1