use of org.hl7.fhir.r4b.model.ImplementationGuide in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeImplementationGuideImplementationGuideDefinitionComponent.
protected void composeImplementationGuideImplementationGuideDefinitionComponent(Complex parent, String parentType, String name, ImplementationGuide.ImplementationGuideDefinitionComponent element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeBackboneElement(t, "definition", name, element, index);
for (int i = 0; i < element.getGrouping().size(); i++) composeImplementationGuideImplementationGuideDefinitionGroupingComponent(t, "ImplementationGuide", "grouping", element.getGrouping().get(i), i);
for (int i = 0; i < element.getResource().size(); i++) composeImplementationGuideImplementationGuideDefinitionResourceComponent(t, "ImplementationGuide", "resource", element.getResource().get(i), i);
if (element.hasPage())
composeImplementationGuideImplementationGuideDefinitionPageComponent(t, "ImplementationGuide", "page", element.getPage(), -1);
for (int i = 0; i < element.getParameter().size(); i++) composeImplementationGuideImplementationGuideDefinitionParameterComponent(t, "ImplementationGuide", "parameter", element.getParameter().get(i), i);
for (int i = 0; i < element.getTemplate().size(); i++) composeImplementationGuideImplementationGuideDefinitionTemplateComponent(t, "ImplementationGuide", "template", element.getTemplate().get(i), i);
}
use of org.hl7.fhir.r4b.model.ImplementationGuide in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeImplementationGuideImplementationGuideDefinitionTemplateComponent.
protected void composeImplementationGuideImplementationGuideDefinitionTemplateComponent(Complex parent, String parentType, String name, ImplementationGuide.ImplementationGuideDefinitionTemplateComponent element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeBackboneElement(t, "template", name, element, index);
if (element.hasCodeElement())
composeCode(t, "ImplementationGuide", "code", element.getCodeElement(), -1);
if (element.hasSourceElement())
composeString(t, "ImplementationGuide", "source", element.getSourceElement(), -1);
if (element.hasScopeElement())
composeString(t, "ImplementationGuide", "scope", element.getScopeElement(), -1);
}
use of org.hl7.fhir.r4b.model.ImplementationGuide in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeImplementationGuideImplementationGuideDependsOnComponent.
protected void composeImplementationGuideImplementationGuideDependsOnComponent(Complex parent, String parentType, String name, ImplementationGuide.ImplementationGuideDependsOnComponent element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeBackboneElement(t, "dependsOn", name, element, index);
if (element.hasUriElement())
composeCanonical(t, "ImplementationGuide", "uri", element.getUriElement(), -1);
if (element.hasPackageIdElement())
composeId(t, "ImplementationGuide", "packageId", element.getPackageIdElement(), -1);
if (element.hasVersionElement())
composeString(t, "ImplementationGuide", "version", element.getVersionElement(), -1);
}
use of org.hl7.fhir.r4b.model.ImplementationGuide in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeImplementationGuideManifestPageComponent.
protected void composeImplementationGuideManifestPageComponent(Complex parent, String parentType, String name, ImplementationGuide.ManifestPageComponent element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeBackboneElement(t, "page", name, element, index);
if (element.hasNameElement())
composeString(t, "ImplementationGuide", "name", element.getNameElement(), -1);
if (element.hasTitleElement())
composeString(t, "ImplementationGuide", "title", element.getTitleElement(), -1);
for (int i = 0; i < element.getAnchor().size(); i++) composeString(t, "ImplementationGuide", "anchor", element.getAnchor().get(i), i);
}
use of org.hl7.fhir.r4b.model.ImplementationGuide in project org.hl7.fhir.core by hapifhir.
the class NPMPackageGenerator method buildPackageJson.
private void buildPackageJson(String canonical, PackageType kind, String web, String genDate, ImplementationGuide ig, List<String> fhirVersion) throws FHIRException, IOException {
CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder();
if (!ig.hasPackageId())
b.append("packageId");
if (!ig.hasVersion())
b.append("version");
if (!ig.hasFhirVersion())
b.append("fhirVersion");
if (!ig.hasLicense())
b.append("license");
for (ImplementationGuideDependsOnComponent d : ig.getDependsOn()) {
if (!d.hasVersion()) {
b.append("dependsOn.version(" + d.getUri() + ")");
}
}
JsonObject npm = new JsonObject();
npm.addProperty("name", ig.getPackageId());
npm.addProperty("version", ig.getVersion());
npm.addProperty("tools-version", ToolsVersion.TOOLS_VERSION);
npm.addProperty("type", kind.getCode());
if (ig.hasLicense())
npm.addProperty("license", ig.getLicense().toCode());
npm.addProperty("canonical", canonical);
npm.addProperty("url", web);
if (ig.hasTitle())
npm.addProperty("title", ig.getTitle());
if (ig.hasDescription())
npm.addProperty("description", ig.getDescription() + " (built " + genDate + timezone() + ")");
if (kind != PackageType.CORE) {
JsonObject dep = new JsonObject();
npm.add("dependencies", dep);
for (String v : fhirVersion) {
// TODO: fix for multiple versions
dep.addProperty("hl7.fhir.core", v);
}
for (ImplementationGuideDependsOnComponent d : ig.getDependsOn()) {
dep.addProperty(d.getPackageId(), d.getVersion());
}
}
if (ig.hasPublisher())
npm.addProperty("author", ig.getPublisher());
JsonArray m = new JsonArray();
for (ContactDetail t : ig.getContact()) {
String email = email(t.getTelecom());
String url = url(t.getTelecom());
if (t.hasName() & (email != null || url != null)) {
JsonObject md = new JsonObject();
m.add(md);
md.addProperty("name", t.getName());
if (email != null)
md.addProperty("email", email);
if (url != null)
md.addProperty("url", url);
}
}
if (m.size() > 0)
npm.add("maintainers", m);
if (ig.getManifest().hasRendering())
npm.addProperty("homepage", ig.getManifest().getRendering());
JsonObject dir = new JsonObject();
npm.add("directories", dir);
dir.addProperty("lib", "package");
dir.addProperty("example", "example");
Gson gson = new GsonBuilder().setPrettyPrinting().create();
String json = gson.toJson(npm);
try {
addFile(Category.RESOURCE, "package.json", json.getBytes("UTF-8"));
} catch (UnsupportedEncodingException e) {
}
packageJ = npm;
}
Aggregations