Search in sources :

Example 31 with ActivityDefinition

use of org.hl7.fhir.r4.model.ActivityDefinition in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeActivityDefinitionActivityDefinitionDynamicValueComponent.

protected void composeActivityDefinitionActivityDefinitionDynamicValueComponent(Complex parent, String parentType, String name, ActivityDefinition.ActivityDefinitionDynamicValueComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "dynamicValue", name, element, index);
    if (element.hasPathElement())
        composeString(t, "ActivityDefinition", "path", element.getPathElement(), -1);
    if (element.hasExpression())
        composeExpression(t, "ActivityDefinition", "expression", element.getExpression(), -1);
}
Also used : Complex(org.hl7.fhir.r4.utils.formats.Turtle.Complex)

Example 32 with ActivityDefinition

use of org.hl7.fhir.r4.model.ActivityDefinition in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeActivityDefinitionActivityDefinitionParticipantComponent.

protected void composeActivityDefinitionActivityDefinitionParticipantComponent(Complex parent, String parentType, String name, ActivityDefinition.ActivityDefinitionParticipantComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "participant", name, element, index);
    if (element.hasTypeElement())
        composeEnum(t, "ActivityDefinition", "type", element.getTypeElement(), -1);
    if (element.hasRole())
        composeCodeableConcept(t, "ActivityDefinition", "role", element.getRole(), -1);
}
Also used : Complex(org.hl7.fhir.r4.utils.formats.Turtle.Complex)

Example 33 with ActivityDefinition

use of org.hl7.fhir.r4.model.ActivityDefinition in project org.hl7.fhir.core by hapifhir.

the class JsonParserTest method testComposeAndParseWithOriginal.

@Test
void testComposeAndParseWithOriginal() throws FHIRFormatError, IOException {
    JsonParser jsonParser = new JsonParser();
    Resource resource = jsonParser.parse(TestingUtilities.loadTestResourceStream("r3", "activitydefinition-referralprimarycarementalhealth-original.json"));
    String composed = jsonParser.composeString(resource);
    jsonParser.parse(composed);
}
Also used : Resource(org.hl7.fhir.dstu3.model.Resource) JsonParser(org.hl7.fhir.dstu3.formats.JsonParser) Test(org.junit.jupiter.api.Test)

Example 34 with ActivityDefinition

use of org.hl7.fhir.r4.model.ActivityDefinition in project org.hl7.fhir.core by hapifhir.

the class DataRenderer method isCanonical.

private boolean isCanonical(String path) {
    if (!path.endsWith(".url"))
        return false;
    String t = path.substring(0, path.length() - 4);
    StructureDefinition sd = getContext().getWorker().fetchTypeDefinition(t);
    if (sd == null)
        return false;
    if (Utilities.existsInList(t, VersionUtilities.getCanonicalResourceNames(getContext().getWorker().getVersion()))) {
        return true;
    }
    if (Utilities.existsInList(t, "ActivityDefinition", "CapabilityStatement", "CapabilityStatement2", "ChargeItemDefinition", "Citation", "CodeSystem", "CompartmentDefinition", "ConceptMap", "ConditionDefinition", "EventDefinition", "Evidence", "EvidenceReport", "EvidenceVariable", "ExampleScenario", "GraphDefinition", "ImplementationGuide", "Library", "Measure", "MessageDefinition", "NamingSystem", "PlanDefinition"))
        return true;
    return sd.getBaseDefinitionElement().hasExtension("http://hl7.org/fhir/StructureDefinition/structuredefinition-codegen-super");
}
Also used : StructureDefinition(org.hl7.fhir.r4b.model.StructureDefinition)

Aggregations

Reference (org.hl7.fhir.dstu3.model.Reference)8 Reference (org.hl7.fhir.r4.model.Reference)8 Resource (org.hl7.fhir.dstu3.model.Resource)6 ArrayList (java.util.ArrayList)5 FHIRException (org.hl7.fhir.exceptions.FHIRException)5 RelatedArtifact (org.hl7.fhir.r4.model.RelatedArtifact)5 Resource (org.hl7.fhir.r4.model.Resource)5 ActivityDefinition (org.hl7.fhir.dstu3.model.ActivityDefinition)4 DomainResource (org.hl7.fhir.dstu3.model.DomainResource)4 ActivityDefinition (org.hl7.fhir.r4.model.ActivityDefinition)4 Attachment (org.hl7.fhir.r4.model.Attachment)4 DomainResource (org.hl7.fhir.r4.model.DomainResource)4 IdType (org.hl7.fhir.dstu3.model.IdType)3 RelatedArtifact (org.hl7.fhir.dstu3.model.RelatedArtifact)3 Complex (org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)3 CanonicalType (org.hl7.fhir.r4.model.CanonicalType)3 SystemRequestDetails (ca.uhn.fhir.jpa.partition.SystemRequestDetails)2 IdDt (ca.uhn.fhir.model.primitive.IdDt)2 IOException (java.io.IOException)2 URI (java.net.URI)2