Search in sources :

Example 46 with Source

use of org.hl7.fhir.utilities.validation.ValidationMessage.Source 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 47 with Source

use of org.hl7.fhir.utilities.validation.ValidationMessage.Source in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeMessageHeader.

protected void composeMessageHeader(Complex parent, String parentType, String name, MessageHeader element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeDomainResource(t, "MessageHeader", name, element, index);
    if (element.hasEvent())
        composeCoding(t, "MessageHeader", "event", element.getEvent(), -1);
    for (int i = 0; i < element.getDestination().size(); i++) composeMessageHeaderMessageDestinationComponent(t, "MessageHeader", "destination", element.getDestination().get(i), i);
    if (element.hasReceiver())
        composeReference(t, "MessageHeader", "receiver", element.getReceiver(), -1);
    if (element.hasSender())
        composeReference(t, "MessageHeader", "sender", element.getSender(), -1);
    if (element.hasTimestampElement())
        composeInstant(t, "MessageHeader", "timestamp", element.getTimestampElement(), -1);
    if (element.hasEnterer())
        composeReference(t, "MessageHeader", "enterer", element.getEnterer(), -1);
    if (element.hasAuthor())
        composeReference(t, "MessageHeader", "author", element.getAuthor(), -1);
    if (element.hasSource())
        composeMessageHeaderMessageSourceComponent(t, "MessageHeader", "source", element.getSource(), -1);
    if (element.hasResponsible())
        composeReference(t, "MessageHeader", "responsible", element.getResponsible(), -1);
    if (element.hasReason())
        composeCodeableConcept(t, "MessageHeader", "reason", element.getReason(), -1);
    if (element.hasResponse())
        composeMessageHeaderMessageHeaderResponseComponent(t, "MessageHeader", "response", element.getResponse(), -1);
    for (int i = 0; i < element.getFocus().size(); i++) composeReference(t, "MessageHeader", "focus", element.getFocus().get(i), i);
}
Also used : Complex(org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)

Example 48 with Source

use of org.hl7.fhir.utilities.validation.ValidationMessage.Source in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeListResource.

protected void composeListResource(Complex parent, String parentType, String name, ListResource element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeDomainResource(t, "List", name, element, index);
    for (int i = 0; i < element.getIdentifier().size(); i++) composeIdentifier(t, "List", "identifier", element.getIdentifier().get(i), i);
    if (element.hasStatusElement())
        composeEnum(t, "List", "status", element.getStatusElement(), -1);
    if (element.hasModeElement())
        composeEnum(t, "List", "mode", element.getModeElement(), -1);
    if (element.hasTitleElement())
        composeString(t, "List", "title", element.getTitleElement(), -1);
    if (element.hasCode())
        composeCodeableConcept(t, "List", "code", element.getCode(), -1);
    if (element.hasSubject())
        composeReference(t, "List", "subject", element.getSubject(), -1);
    if (element.hasEncounter())
        composeReference(t, "List", "encounter", element.getEncounter(), -1);
    if (element.hasDateElement())
        composeDateTime(t, "List", "date", element.getDateElement(), -1);
    if (element.hasSource())
        composeReference(t, "List", "source", element.getSource(), -1);
    if (element.hasOrderedBy())
        composeCodeableConcept(t, "List", "orderedBy", element.getOrderedBy(), -1);
    for (int i = 0; i < element.getNote().size(); i++) composeAnnotation(t, "List", "note", element.getNote().get(i), i);
    for (int i = 0; i < element.getEntry().size(); i++) composeListResourceListEntryComponent(t, "List", "entry", element.getEntry().get(i), i);
    if (element.hasEmptyReason())
        composeCodeableConcept(t, "List", "emptyReason", element.getEmptyReason(), -1);
}
Also used : Complex(org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)

Example 49 with Source

use of org.hl7.fhir.utilities.validation.ValidationMessage.Source 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)

Example 50 with Source

use of org.hl7.fhir.utilities.validation.ValidationMessage.Source in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeMessageHeaderMessageSourceComponent.

protected void composeMessageHeaderMessageSourceComponent(Complex parent, String parentType, String name, MessageHeader.MessageSourceComponent 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.hasNameElement())
        composeString(t, "MessageHeader", "name", element.getNameElement(), -1);
    if (element.hasSoftwareElement())
        composeString(t, "MessageHeader", "software", element.getSoftwareElement(), -1);
    if (element.hasVersionElement())
        composeString(t, "MessageHeader", "version", element.getVersionElement(), -1);
    if (element.hasContact())
        composeContactPoint(t, "MessageHeader", "contact", element.getContact(), -1);
    if (element.hasEndpointElement())
        composeUri(t, "MessageHeader", "endpoint", element.getEndpointElement(), -1);
}
Also used : Complex(org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)

Aggregations

FHIRException (org.hl7.fhir.exceptions.FHIRException)125 FileInputStream (java.io.FileInputStream)59 FileOutputStream (java.io.FileOutputStream)55 IOException (java.io.IOException)55 ArrayList (java.util.ArrayList)48 File (java.io.File)45 CSFileInputStream (org.hl7.fhir.utilities.CSFileInputStream)45 TextFile (org.hl7.fhir.utilities.TextFile)41 CSFile (org.hl7.fhir.utilities.CSFile)35 XhtmlNode (org.hl7.fhir.utilities.xhtml.XhtmlNode)35 Complex (org.hl7.fhir.r4.utils.formats.Turtle.Complex)30 XmlParser (org.hl7.fhir.r5.formats.XmlParser)28 Date (java.util.Date)27 HashMap (java.util.HashMap)26 Reference (org.hl7.fhir.r4.model.Reference)26 DefinitionException (org.hl7.fhir.exceptions.DefinitionException)24 FHIRFormatError (org.hl7.fhir.exceptions.FHIRFormatError)24 Coding (org.hl7.fhir.r4.model.Coding)24 JsonObject (com.google.gson.JsonObject)22 NotImplementedException (org.apache.commons.lang3.NotImplementedException)22