Search in sources :

Example 6 with ImplementationGuide

use of org.hl7.fhir.r5.model.ImplementationGuide in project kindling by HL7.

the class Regenerator method generatePacks.

public void generatePacks(ResourceDefn r, String root) throws IOException {
    ListResource list = new ListResource();
    list.setId(r.getName() + "-packs");
    list.setStatus(ListStatus.CURRENT);
    list.setMode(ListMode.WORKING);
    // }
    for (Profile p : r.getConformancePackages()) {
        ListResourceEntryComponent li = list.addEntry();
        li.getItem().setReference("ImplementationGuide/" + r.getName() + "-" + p.getCategory());
    }
    File fn = new File(Utilities.path(root, list.fhirType().toLowerCase() + "-" + list.getId() + ".gen.xml"));
    new XmlParser().setOutputStyle(OutputStyle.PRETTY).compose(new FileOutputStream(fn), list);
    fn.setLastModified(r.getTimestamp());
    // }
    for (Profile p : r.getConformancePackages()) {
        generateCP(root, r, p);
    }
}
Also used : XmlParser(org.hl7.fhir.r5.formats.XmlParser) ListResourceEntryComponent(org.hl7.fhir.r5.model.ListResource.ListResourceEntryComponent) FileOutputStream(java.io.FileOutputStream) ListResource(org.hl7.fhir.r5.model.ListResource) File(java.io.File) Profile(org.hl7.fhir.definitions.model.Profile)

Example 7 with ImplementationGuide

use of org.hl7.fhir.r5.model.ImplementationGuide in project drug-formulary-ri by HL7-DaVinci.

the class MetadataProvider method getServerConformance.

@Override
public CapabilityStatement getServerConformance(HttpServletRequest theRequest, RequestDetails theRequestDetails) {
    CapabilityStatement metadata = super.getServerConformance(theRequest, theRequestDetails);
    // Remove HAPI defined default OperationDefinitions (Their definitions are not a
    // Canonical URL)
    removeOperations(metadata.getRest());
    metadata.addInstantiates("http://hl7.org/fhir/us/davinci-drug-formulary/CapabilityStatement/usdf-server");
    metadata.setTitle("Da Vinci US Drug Formulary Reference Implementation");
    metadata.setStatus(PublicationStatus.DRAFT);
    metadata.setExperimental(true);
    metadata.setPublisher("Da Vinci");
    Calendar calendar = Calendar.getInstance();
    calendar.set(2022, 3, 5, 0, 0, 0);
    metadata.setDate(calendar.getTime());
    CapabilityStatementSoftwareComponent software = new CapabilityStatementSoftwareComponent();
    software.setName("https://github.com/HL7-DaVinci/drug-formulary-ri");
    metadata.setSoftware(software);
    metadata.addImplementationGuide("http://hl7.org/fhir/us/davinci-drug-formulary/ImplementationGuide/hl7.fhir.us.davinci-drug-formulary");
    metadata.addImplementationGuide("https://wiki.hl7.org/Da_Vinci_PDex-formulary_FHIR_IG_Proposal");
    metadata.setVersion("1.2.0");
    updateRestComponents(metadata.getRest());
    return metadata;
}
Also used : Calendar(java.util.Calendar) CapabilityStatement(org.hl7.fhir.r4.model.CapabilityStatement)

Example 8 with ImplementationGuide

use of org.hl7.fhir.r5.model.ImplementationGuide in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeImplementationGuideImplementationGuideDependencyComponent.

protected void composeImplementationGuideImplementationGuideDependencyComponent(Complex parent, String parentType, String name, ImplementationGuide.ImplementationGuideDependencyComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "dependency", name, element, index);
    if (element.hasTypeElement())
        composeEnum(t, "ImplementationGuide", "type", element.getTypeElement(), -1);
    if (element.hasUriElement())
        composeUri(t, "ImplementationGuide", "uri", element.getUriElement(), -1);
}
Also used : Complex(org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)

Example 9 with ImplementationGuide

use of org.hl7.fhir.r5.model.ImplementationGuide in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeImplementationGuideImplementationGuideContactComponent.

protected void composeImplementationGuideImplementationGuideContactComponent(Complex parent, String parentType, String name, ImplementationGuide.ImplementationGuideContactComponent 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, "ImplementationGuide", "name", element.getNameElement(), -1);
    for (int i = 0; i < element.getTelecom().size(); i++) composeContactPoint(t, "ImplementationGuide", "telecom", element.getTelecom().get(i), i);
}
Also used : Complex(org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)

Example 10 with ImplementationGuide

use of org.hl7.fhir.r5.model.ImplementationGuide in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeImplementationGuideImplementationGuidePackageComponent.

protected void composeImplementationGuideImplementationGuidePackageComponent(Complex parent, String parentType, String name, ImplementationGuide.ImplementationGuidePackageComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "package", name, element, index);
    if (element.hasNameElement())
        composeString(t, "ImplementationGuide", "name", element.getNameElement(), -1);
    if (element.hasDescriptionElement())
        composeString(t, "ImplementationGuide", "description", element.getDescriptionElement(), -1);
    for (int i = 0; i < element.getResource().size(); i++) composeImplementationGuideImplementationGuidePackageResourceComponent(t, "ImplementationGuide", "resource", element.getResource().get(i), i);
}
Also used : Complex(org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)

Aggregations

ImplementationGuide (org.hl7.fhir.r5.model.ImplementationGuide)16 Complex (org.hl7.fhir.r4.utils.formats.Turtle.Complex)13 StructureDefinition (org.hl7.fhir.r5.model.StructureDefinition)12 FHIRException (org.hl7.fhir.exceptions.FHIRException)11 DefinitionException (org.hl7.fhir.exceptions.DefinitionException)9 File (java.io.File)8 JsonObject (com.google.gson.JsonObject)7 Complex (org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)7 Complex (org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)7 XmlParser (org.hl7.fhir.r5.formats.XmlParser)6 SearchParameter (org.hl7.fhir.r5.model.SearchParameter)5 Gson (com.google.gson.Gson)4 GsonBuilder (com.google.gson.GsonBuilder)4 JsonArray (com.google.gson.JsonArray)4 FileInputStream (java.io.FileInputStream)4 FileOutputStream (java.io.FileOutputStream)4 IOException (java.io.IOException)4 ArrayList (java.util.ArrayList)4 CanonicalResource (org.hl7.fhir.r5.model.CanonicalResource)4 ValueSet (org.hl7.fhir.r5.model.ValueSet)4