use of org.hl7.fhir.r4.model.ElementDefinition in project kindling by HL7.
the class SpreadSheetReloader method parseBinding.
private void parseBinding(ElementDefinition ed, String value, XSSFSheet bindings) {
if (Utilities.noString(value)) {
ed.setBinding(null);
} else {
XSSFRow cols = bindings.getRow(0);
XSSFRow row = lookupRow(bindings, cols, CN_BINDING_NAME, value);
if (row == null) {
throw new FHIRException("Unable to find binding " + value + " in " + xlsx);
}
ElementDefinitionBindingComponent bs = ed.getBinding();
bs.removeExtension(BuildExtensions.EXT_NAME);
readExt(bs, row, cols, CN_BINDING_NAME, BuildExtensions.EXT_BINDING_NAME, ExtensionType.String);
readExt(bs, row, cols, CN_DEFINITION, BuildExtensions.EXT_DEFINITION, ExtensionType.String);
bs.setStrength(BindingStrength.fromCode(getValue(row, cols, CN_STRENGTH)));
bs.setValueSet(getValue(row, cols, CN_VALUE_SET));
readExt(bs, row, cols, CN_OID, BuildExtensions.EXT_VS_OID, ExtensionType.String);
readExt(bs, row, cols, CN_URI, BuildExtensions.EXT_URI, ExtensionType.String);
readExt(bs, row, cols, CN_WEBSITE_EMAIL, BuildExtensions.EXT_WEBSITE, ExtensionType.Uri);
readExt(bs, row, cols, CN_V2, BuildExtensions.EXT_V2_MAP, ExtensionType.String);
readExt(bs, row, cols, CN_V3, BuildExtensions.EXT_V3_MAP, ExtensionType.String);
readExt(bs, row, cols, CN_COPYRIGHT, BuildExtensions.EXT_COPYRIGHT, ExtensionType.String);
readExt(bs, row, cols, CN_COMMITTEE_NOTES, BuildExtensions.EXT_COMMITTEE_NOTES, ExtensionType.Markdown);
}
}
use of org.hl7.fhir.r4.model.ElementDefinition in project kindling by HL7.
the class SpreadSheetCreator method type.
private String type(ElementDefinition ed) {
if (ed.hasContentReference()) {
return ed.getContentReference();
}
List<String> tl = new ArrayList<>();
for (TypeRefComponent tr : ed.getType()) {
String s;
if (tr.getCode().equals("canonical") && tr.hasExtension(BuildExtensions.EXT_PATTERN)) {
s = "canonical(" + tr.getExtensionString(BuildExtensions.EXT_PATTERN).substring(40) + ")";
} else {
s = summary(tr);
if (s == null) {
return null;
}
}
tl.add(s);
}
return String.join(" | ", tl);
}
use of org.hl7.fhir.r4.model.ElementDefinition in project kindling by HL7.
the class SpreadSheetCreator method addResourceSheets.
private XSSFSheet addResourceSheets(XSSFWorkbook excel) throws FHIRFormatError, FileNotFoundException, IOException {
StructureDefinition sd = (StructureDefinition) parseXml(fnSD());
sd.setText(null);
XSSFSheet resource = excel.createSheet(SpreadSheetCreator.SN_RESOURCE);
XSSFSheet bindings = excel.createSheet(SpreadSheetCreator.SN_BINDINGS);
XSSFSheet invariants = excel.createSheet(SpreadSheetCreator.SN_INVARIANTS);
addResourceColumns(resource, sd);
addBindingColumns(bindings, sd);
addInvariantColumns(invariants, sd);
int rowCount = 0;
invRowCount = 1;
bindingRowCount = 1;
for (ElementDefinition ed : sd.getDifferential().getElement()) {
rowCount++;
addElements(resource, bindings, invariants, ed, rowCount);
}
return bindings;
}
use of org.hl7.fhir.r4.model.ElementDefinition in project kindling by HL7.
the class CDAGenerator method addEDElements.
private void addEDElements(List<ElementDefinition> list) {
ElementDefinition ed = new ElementDefinition();
ed.setPath("ED.representation");
seePath(ed);
ed.setMin(0);
ed.setMax("1");
ed.addType().setCode("code");
ed.addRepresentation(PropertyRepresentation.XMLATTR);
list.add(ed);
ed = new ElementDefinition();
ed.setPath("ED.text");
seePath(ed);
ed.setMin(0);
ed.setMax("1");
ed.addType().setCode("string");
ed.addRepresentation(PropertyRepresentation.XMLTEXT);
list.add(ed);
ed = new ElementDefinition();
ed.setPath("ED.data");
seePath(ed);
ed.setMin(0);
ed.setMax("1");
ed.addType().setCode("base64Binary");
ed.addRepresentation(PropertyRepresentation.XMLTEXT);
list.add(ed);
}
use of org.hl7.fhir.r4.model.ElementDefinition in project kindling by HL7.
the class CDAGenerator method addParts.
private void addParts(List<ElementDefinition> list, String n, String... parts) {
for (String p : parts) {
ElementDefinition ed = new ElementDefinition();
ed.setPath(n + "." + p);
seePath(ed);
ed.setMin(0);
ed.setMax("*");
ed.addType().setCode("http://hl7.org/fhir/cda/StructureDefinition/ST");
list.add(ed);
}
}
Aggregations