Search in sources :

Example 26 with NamingSystem

use of org.hl7.fhir.r4b.model.NamingSystem in project org.hl7.fhir.core by hapifhir.

the class TurtleTests method test_namingsystem_example_id.

@Test
public void test_namingsystem_example_id() throws FileNotFoundException, IOException, Exception {
    System.out.println("namingsystem-example-id.ttl");
    new Turtle().parse(TextFile.fileToString("C:\\work\\org.hl7.fhir\\build\\publish\\namingsystem-example-id.ttl"));
}
Also used : Turtle(org.hl7.fhir.dstu3.utils.formats.Turtle) Test(org.junit.jupiter.api.Test)

Example 27 with NamingSystem

use of org.hl7.fhir.r4b.model.NamingSystem in project org.hl7.fhir.core by hapifhir.

the class TurtleTests method test_namingsystem_example_replaced.

@Test
public void test_namingsystem_example_replaced() throws FileNotFoundException, IOException, Exception {
    System.out.println("namingsystem-example-replaced.ttl");
    new Turtle().parse(TextFile.fileToString("C:\\work\\org.hl7.fhir\\build\\publish\\namingsystem-example-replaced.ttl"));
}
Also used : Turtle(org.hl7.fhir.dstu3.utils.formats.Turtle) Test(org.junit.jupiter.api.Test)

Example 28 with NamingSystem

use of org.hl7.fhir.r4b.model.NamingSystem in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeNamingSystemNamingSystemUniqueIdComponent.

protected void composeNamingSystemNamingSystemUniqueIdComponent(Complex parent, String parentType, String name, NamingSystem.NamingSystemUniqueIdComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "uniqueId", name, element, index);
    if (element.hasTypeElement())
        composeEnum(t, "NamingSystem", "type", element.getTypeElement(), -1);
    if (element.hasValueElement())
        composeString(t, "NamingSystem", "value", element.getValueElement(), -1);
    if (element.hasPreferredElement())
        composeBoolean(t, "NamingSystem", "preferred", element.getPreferredElement(), -1);
    if (element.hasCommentElement())
        composeString(t, "NamingSystem", "comment", element.getCommentElement(), -1);
    if (element.hasPeriod())
        composePeriod(t, "NamingSystem", "period", element.getPeriod(), -1);
}
Also used : Complex(org.hl7.fhir.r4.utils.formats.Turtle.Complex)

Example 29 with NamingSystem

use of org.hl7.fhir.r4b.model.NamingSystem in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeNamingSystemNamingSystemContactComponent.

protected void composeNamingSystemNamingSystemContactComponent(Complex parent, String parentType, String name, NamingSystem.NamingSystemContactComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "contact", name, element, index);
    if (element.hasNameElement())
        composeString(t, "NamingSystem", "name", element.getNameElement(), -1);
    for (int i = 0; i < element.getTelecom().size(); i++) composeContactPoint(t, "NamingSystem", "telecom", element.getTelecom().get(i), i);
}
Also used : Complex(org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)

Example 30 with NamingSystem

use of org.hl7.fhir.r4b.model.NamingSystem 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

DefinitionException (org.hl7.fhir.exceptions.DefinitionException)8 CodeSystem (org.hl7.fhir.r5.model.CodeSystem)6 NamingSystem (org.hl7.fhir.r5.model.NamingSystem)6 Test (org.junit.jupiter.api.Test)6 FHIRException (org.hl7.fhir.exceptions.FHIRException)5 FileNotFoundException (java.io.FileNotFoundException)4 IOException (java.io.IOException)4 Turtle (org.hl7.fhir.dstu3.utils.formats.Turtle)4 StructureDefinition (org.hl7.fhir.r5.model.StructureDefinition)4 ValueSet (org.hl7.fhir.r5.model.ValueSet)4 FileOutputStream (java.io.FileOutputStream)3 ArrayList (java.util.ArrayList)3 Complex (org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)3 StructureDefinition (org.hl7.fhir.r4b.model.StructureDefinition)3 CanonicalResource (org.hl7.fhir.r5.model.CanonicalResource)3 CapabilityStatement (org.hl7.fhir.r5.model.CapabilityStatement)3 NamingSystemUniqueIdComponent (org.hl7.fhir.r5.model.NamingSystem.NamingSystemUniqueIdComponent)3 DataFormatException (ca.uhn.fhir.parser.DataFormatException)2 File (java.io.File)2 TransformerException (javax.xml.transform.TransformerException)2