use of org.hl7.fhir.utilities.StandardsStatus in project kindling by HL7.
the class LogicalModelProcessor method processCommand.
@Override
protected String processCommand(String command, String[] com) throws Exception {
if (com[0].equals("lmheader"))
return lmHeader(name, definition.getId(), com.length > 1 ? com[1] : null, true);
else if (com[0].equals("svg"))
return new SvgGenerator(page, genlevel(), null, true, false, version).generate(definition, com[1], "");
else if (com[0].equals("draft-note"))
return page.getDraftNote(definition);
else if (com[0].equals("definition"))
return definition.getDescription();
else if (com[0].equals("tx"))
return tx;
else if (com[0].equals("inv"))
return genConstraints(definition);
else if (com[0].equals("resource-table"))
return genLogicalModelTable(definition, genlevel());
else if (com[0].equals("dictionary"))
return dict;
else if (com[0].equals("lmexamples"))
return genExampleList();
else if (com[0].equals("resref"))
return "{todo}";
else if (com[0].equals("maponthispage"))
return "{todo}";
else if (com[0].equals("mappings"))
return "{todo}";
else if (com[0].equals("fmm-style")) {
String fmm = ToolingExtensions.readStringExtension(definition, ToolingExtensions.EXT_FMM_LEVEL);
StandardsStatus ss = ToolingExtensions.getStandardsStatus(definition);
if (StandardsStatus.EXTERNAL == ss)
return "colse";
else
return "colsi";
} else if (com[0].equals("fmm")) {
String fmm = ToolingExtensions.readStringExtension(definition, ToolingExtensions.EXT_FMM_LEVEL);
StandardsStatus ss = ToolingExtensions.getStandardsStatus(definition);
if (StandardsStatus.EXTERNAL == ss)
return getFmmFromlevel("", "N/A");
else
return getFmmFromlevel("", fmm);
} else if (com[0].equals("wg")) {
String wg = ToolingExtensions.readStringExtension(definition, ToolingExtensions.EXT_WORKGROUP);
return (wg == null || !definitions.getWorkgroups().containsKey(wg) ? "(No assigned work group)" : "<a _target=\"blank\" href=\"" + definitions.getWorkgroups().get(wg).getUrl() + "\">" + definitions.getWorkgroups().get(wg).getName() + "</a> Work Group");
} else if (com[0].equals("fmm-style")) {
String fmm = ToolingExtensions.readStringExtension(definition, ToolingExtensions.EXT_FMM_LEVEL);
StandardsStatus ss = ToolingExtensions.getStandardsStatus(definition);
if (StandardsStatus.EXTERNAL == ss)
return "colse";
else
return "colsi";
} else if (com[0].equals("wgt")) {
String fmm = ToolingExtensions.readStringExtension(definition, ToolingExtensions.EXT_FMM_LEVEL);
StandardsStatus ss = ToolingExtensions.getStandardsStatus(definition);
if (StandardsStatus.EXTERNAL == ss)
return getFmmFromlevel("", "N/A");
else
return getFmmFromlevel("", fmm);
} else
return super.processCommand(command, com);
}
use of org.hl7.fhir.utilities.StandardsStatus in project org.hl7.fhir.core by hapifhir.
the class ValueSetUtilities method markStatus.
public static void markStatus(ValueSet vs, String wg, StandardsStatus status, String pckage, String fmm, IWorkerContext context, String normativeVersion) throws FHIRException {
if (vs.hasUserData("external.url"))
return;
if (wg != null) {
if (!ToolingExtensions.hasExtension(vs, ToolingExtensions.EXT_WORKGROUP) || (!Utilities.existsInList(ToolingExtensions.readStringExtension(vs, ToolingExtensions.EXT_WORKGROUP), "fhir", "vocab") && Utilities.existsInList(wg, "fhir", "vocab"))) {
ToolingExtensions.setCodeExtension(vs, ToolingExtensions.EXT_WORKGROUP, wg);
}
}
if (status != null) {
StandardsStatus ss = ToolingExtensions.getStandardsStatus(vs);
if (ss == null || ss.isLowerThan(status))
ToolingExtensions.setStandardsStatus(vs, status, normativeVersion);
if (pckage != null) {
if (!vs.hasUserData("ballot.package"))
vs.setUserData("ballot.package", pckage);
else if (!pckage.equals(vs.getUserString("ballot.package")))
if (!"infrastructure".equals(vs.getUserString("ballot.package")))
System.out.println("Value Set " + vs.getUrl() + ": ownership clash " + pckage + " vs " + vs.getUserString("ballot.package"));
}
if (status == StandardsStatus.NORMATIVE) {
vs.setExperimental(false);
vs.setStatus(PublicationStatus.ACTIVE);
}
}
if (fmm != null) {
String sfmm = ToolingExtensions.readStringExtension(vs, ToolingExtensions.EXT_FMM_LEVEL);
if (Utilities.noString(sfmm) || Integer.parseInt(sfmm) < Integer.parseInt(fmm))
ToolingExtensions.setIntegerExtension(vs, ToolingExtensions.EXT_FMM_LEVEL, Integer.parseInt(fmm));
}
if (vs.hasUserData("cs"))
CodeSystemUtilities.markStatus((CodeSystem) vs.getUserData("cs"), wg, status, pckage, fmm, normativeVersion);
else if (status == StandardsStatus.NORMATIVE && context != null) {
for (ConceptSetComponent csc : vs.getCompose().getInclude()) {
if (csc.hasSystem()) {
CodeSystem cs = context.fetchCodeSystem(csc.getSystem());
if (cs != null) {
CodeSystemUtilities.markStatus(cs, wg, status, pckage, fmm, normativeVersion);
}
}
}
}
}
use of org.hl7.fhir.utilities.StandardsStatus in project org.hl7.fhir.core by hapifhir.
the class CodeSystemUtilities method markStatus.
public static void markStatus(CodeSystem cs, String wg, StandardsStatus status, String pckage, String fmm, String normativeVersion) throws FHIRException {
if (wg != null) {
if (!ToolingExtensions.hasExtension(cs, ToolingExtensions.EXT_WORKGROUP) || (Utilities.existsInList(ToolingExtensions.readStringExtension(cs, ToolingExtensions.EXT_WORKGROUP), "fhir", "vocab") && !Utilities.existsInList(wg, "fhir", "vocab"))) {
ToolingExtensions.setCodeExtension(cs, ToolingExtensions.EXT_WORKGROUP, wg);
}
}
if (status != null) {
StandardsStatus ss = ToolingExtensions.getStandardsStatus(cs);
if (ss == null || ss.isLowerThan(status))
ToolingExtensions.setStandardsStatus(cs, status, normativeVersion);
if (pckage != null) {
if (!cs.hasUserData("ballot.package"))
cs.setUserData("ballot.package", pckage);
else if (!pckage.equals(cs.getUserString("ballot.package")))
if (!"infrastructure".equals(cs.getUserString("ballot.package")))
System.out.println("Code System " + cs.getUrl() + ": ownership clash " + pckage + " vs " + cs.getUserString("ballot.package"));
}
if (status == StandardsStatus.NORMATIVE) {
cs.setExperimental(false);
cs.setStatus(PublicationStatus.ACTIVE);
}
}
if (fmm != null) {
String sfmm = ToolingExtensions.readStringExtension(cs, ToolingExtensions.EXT_FMM_LEVEL);
if (Utilities.noString(sfmm) || Integer.parseInt(sfmm) < Integer.parseInt(fmm))
ToolingExtensions.setIntegerExtension(cs, ToolingExtensions.EXT_FMM_LEVEL, Integer.parseInt(fmm));
}
}
use of org.hl7.fhir.utilities.StandardsStatus in project org.hl7.fhir.core by hapifhir.
the class ValueSetUtilities method markStatus.
public static void markStatus(ValueSet vs, String wg, StandardsStatus status, String pckage, String fmm, IWorkerContext context, String normativeVersion) throws FHIRException {
if (vs.hasUserData("external.url"))
return;
if (wg != null) {
if (!ToolingExtensions.hasExtension(vs, ToolingExtensions.EXT_WORKGROUP) || (!Utilities.existsInList(ToolingExtensions.readStringExtension(vs, ToolingExtensions.EXT_WORKGROUP), "fhir", "vocab") && Utilities.existsInList(wg, "fhir", "vocab"))) {
ToolingExtensions.setCodeExtension(vs, ToolingExtensions.EXT_WORKGROUP, wg);
}
}
if (status != null) {
StandardsStatus ss = ToolingExtensions.getStandardsStatus(vs);
if (ss == null || ss.isLowerThan(status))
ToolingExtensions.setStandardsStatus(vs, status, normativeVersion);
if (pckage != null) {
if (!vs.hasUserData("ballot.package"))
vs.setUserData("ballot.package", pckage);
else if (!pckage.equals(vs.getUserString("ballot.package")))
if (!"infrastructure".equals(vs.getUserString("ballot.package")))
System.out.println("Value Set " + vs.getUrl() + ": ownership clash " + pckage + " vs " + vs.getUserString("ballot.package"));
}
if (status == StandardsStatus.NORMATIVE) {
vs.setExperimental(false);
vs.setStatus(PublicationStatus.ACTIVE);
}
}
if (fmm != null) {
String sfmm = ToolingExtensions.readStringExtension(vs, ToolingExtensions.EXT_FMM_LEVEL);
if (Utilities.noString(sfmm) || Integer.parseInt(sfmm) < Integer.parseInt(fmm)) {
ToolingExtensions.setIntegerExtension(vs, ToolingExtensions.EXT_FMM_LEVEL, Integer.parseInt(fmm));
}
if (Integer.parseInt(fmm) <= 1) {
vs.setExperimental(true);
}
}
if (vs.hasUserData("cs"))
CodeSystemUtilities.markStatus((CodeSystem) vs.getUserData("cs"), wg, status, pckage, fmm, normativeVersion);
else if (status == StandardsStatus.NORMATIVE && context != null) {
for (ConceptSetComponent csc : vs.getCompose().getInclude()) {
if (csc.hasSystem()) {
CodeSystem cs = context.fetchCodeSystem(csc.getSystem());
if (cs != null) {
CodeSystemUtilities.markStatus(cs, wg, status, pckage, fmm, normativeVersion);
}
}
}
}
}
use of org.hl7.fhir.utilities.StandardsStatus in project org.hl7.fhir.core by hapifhir.
the class CodeSystemUtilities method markStatus.
public static void markStatus(CodeSystem cs, String wg, StandardsStatus status, String pckage, String fmm, String normativeVersion) throws FHIRException {
if (wg != null) {
if (!ToolingExtensions.hasExtension(cs, ToolingExtensions.EXT_WORKGROUP) || (Utilities.existsInList(ToolingExtensions.readStringExtension(cs, ToolingExtensions.EXT_WORKGROUP), "fhir", "vocab") && !Utilities.existsInList(wg, "fhir", "vocab"))) {
ToolingExtensions.setCodeExtension(cs, ToolingExtensions.EXT_WORKGROUP, wg);
}
}
if (status != null) {
StandardsStatus ss = ToolingExtensions.getStandardsStatus(cs);
if (ss == null || ss.isLowerThan(status))
ToolingExtensions.setStandardsStatus(cs, status, normativeVersion);
if (pckage != null) {
if (!cs.hasUserData("ballot.package"))
cs.setUserData("ballot.package", pckage);
else if (!pckage.equals(cs.getUserString("ballot.package")))
if (!"infrastructure".equals(cs.getUserString("ballot.package")))
System.out.println("Code System " + cs.getUrl() + ": ownership clash " + pckage + " vs " + cs.getUserString("ballot.package"));
}
if (status == StandardsStatus.NORMATIVE) {
cs.setExperimental(false);
cs.setStatus(PublicationStatus.ACTIVE);
}
}
if (fmm != null) {
String sfmm = ToolingExtensions.readStringExtension(cs, ToolingExtensions.EXT_FMM_LEVEL);
if (Utilities.noString(sfmm) || Integer.parseInt(sfmm) < Integer.parseInt(fmm)) {
ToolingExtensions.setIntegerExtension(cs, ToolingExtensions.EXT_FMM_LEVEL, Integer.parseInt(fmm));
}
if (Integer.parseInt(fmm) <= 1) {
cs.setExperimental(true);
}
}
}
Aggregations