use of org.hl7.fhir.r5.model.NamingSystem in project org.hl7.fhir.core by hapifhir.
the class NamingSystemRenderer method render.
public boolean render(XhtmlNode x, NamingSystem ns) throws FHIRFormatError, DefinitionException, IOException {
x.h3().tx("Summary");
XhtmlNode tbl = x.table("grid");
row(tbl, "Defining URL", ns.getUrl());
if (ns.hasVersion()) {
row(tbl, "Version", ns.getVersion());
}
if (ns.hasName()) {
row(tbl, "Name", gt(ns.getNameElement()));
}
if (ns.hasTitle()) {
row(tbl, "Title", gt(ns.getTitleElement()));
}
row(tbl, "Status", ns.getStatus().toCode());
if (ns.hasDescription()) {
addMarkdown(row(tbl, "Definition"), ns.getDescription());
}
if (ns.hasPublisher()) {
row(tbl, "Publisher", gt(ns.getPublisherElement()));
}
if (ns.hasExtension(ToolingExtensions.EXT_WORKGROUP)) {
renderCommitteeLink(row(tbl, "Committee"), ns);
}
if (CodeSystemUtilities.hasOID(ns)) {
row(tbl, "OID", CodeSystemUtilities.getOID(ns)).tx("(" + translate("ns.summary", "for OID based terminology systems") + ")");
}
if (ns.hasCopyright()) {
addMarkdown(row(tbl, "Copyright"), ns.getCopyright());
}
boolean hasPreferred = false;
boolean hasPeriod = false;
boolean hasComment = false;
for (NamingSystemUniqueIdComponent id : ns.getUniqueId()) {
hasPreferred = hasPreferred || id.hasPreferred();
hasPeriod = hasPeriod || id.hasPeriod();
hasComment = hasComment || id.hasComment();
}
x.h3().tx("Identifiers");
tbl = x.table("grid");
XhtmlNode tr = tbl.tr();
tr.td().b().tx(translate("ns.summary", "Type"));
tr.td().b().tx(translate("ns.summary", "Value"));
if (hasPreferred) {
tr.td().b().tx(translate("ns.summary", "Preferred"));
}
if (hasPeriod) {
tr.td().b().tx(translate("ns.summary", "Period"));
}
if (hasComment) {
tr.td().b().tx(translate("ns.summary", "Comment"));
}
for (NamingSystemUniqueIdComponent id : ns.getUniqueId()) {
tr = tbl.tr();
tr.td().tx(id.getType().getDisplay());
tr.td().tx(id.getValue());
if (hasPreferred) {
tr.td().tx(id.getPreferredElement().primitiveValue());
}
if (hasPeriod) {
tr.td().tx(display(id.getPeriod()));
}
if (hasComment) {
tr.td().tx(id.getComment());
}
}
return false;
}
use of org.hl7.fhir.r5.model.NamingSystem in project org.hl7.fhir.core by hapifhir.
the class TurtleTests method test_namingsystem_example.
@Test
public void test_namingsystem_example() throws FileNotFoundException, IOException, Exception {
System.out.println("namingsystem-example.ttl");
new Turtle().parse(TextFile.fileToString("C:\\work\\org.hl7.fhir\\build\\publish\\namingsystem-example.ttl"));
}
use of org.hl7.fhir.r5.model.NamingSystem in project org.hl7.fhir.core by hapifhir.
the class TurtleTests method test_namingsystem_registry.
@Test
public void test_namingsystem_registry() throws FileNotFoundException, IOException, Exception {
System.out.println("namingsystem-registry.ttl");
new Turtle().parse(TextFile.fileToString("C:\\work\\org.hl7.fhir\\build\\publish\\namingsystem-registry.ttl"));
}
use of org.hl7.fhir.r5.model.NamingSystem in project org.hl7.fhir.core by hapifhir.
the class NamingSystemRenderer method render.
public boolean render(XhtmlNode x, NamingSystem ns) throws FHIRFormatError, DefinitionException, IOException {
x.h3().tx("Summary");
XhtmlNode tbl = x.table("grid");
row(tbl, "Defining URL", ns.getUrl());
if (ns.hasVersion()) {
row(tbl, "Version", ns.getVersion());
}
if (ns.hasName()) {
row(tbl, "Name", gt(ns.getNameElement()));
}
if (ns.hasTitle()) {
row(tbl, "Title", gt(ns.getTitleElement()));
}
row(tbl, "Status", ns.getStatus().toCode());
if (ns.hasDescription()) {
addMarkdown(row(tbl, "Definition"), ns.getDescription());
}
if (ns.hasPublisher()) {
row(tbl, "Publisher", gt(ns.getPublisherElement()));
}
if (ns.hasExtension(ToolingExtensions.EXT_WORKGROUP)) {
renderCommitteeLink(row(tbl, "Committee"), ns);
}
if (CodeSystemUtilities.hasOID(ns)) {
row(tbl, "OID", CodeSystemUtilities.getOID(ns)).tx("(" + translate("ns.summary", "for OID based terminology systems") + ")");
}
if (ns.hasCopyright()) {
addMarkdown(row(tbl, "Copyright"), ns.getCopyright());
}
boolean hasPreferred = false;
boolean hasPeriod = false;
boolean hasComment = false;
for (NamingSystemUniqueIdComponent id : ns.getUniqueId()) {
hasPreferred = hasPreferred || id.hasPreferred();
hasPeriod = hasPeriod || id.hasPeriod();
hasComment = hasComment || id.hasComment();
}
x.h3().tx("Identifiers");
tbl = x.table("grid");
XhtmlNode tr = tbl.tr();
tr.td().b().tx(translate("ns.summary", "Type"));
tr.td().b().tx(translate("ns.summary", "Value"));
if (hasPreferred) {
tr.td().b().tx(translate("ns.summary", "Preferred"));
}
if (hasPeriod) {
tr.td().b().tx(translate("ns.summary", "Period"));
}
if (hasComment) {
tr.td().b().tx(translate("ns.summary", "Comment"));
}
for (NamingSystemUniqueIdComponent id : ns.getUniqueId()) {
tr = tbl.tr();
tr.td().tx(id.getType().getDisplay());
tr.td().tx(id.getValue());
if (hasPreferred) {
tr.td().tx(id.getPreferredElement().primitiveValue());
}
if (hasPeriod) {
tr.td().tx(display(id.getPeriod()));
}
if (hasComment) {
tr.td().tx(id.getComment());
}
}
return false;
}
use of org.hl7.fhir.r5.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");
}
Aggregations