use of org.hl7.fhir.exceptions.FHIRFormatError in project kindling by HL7.
the class SpreadSheetCreator method addSearchParams.
private void addSearchParams(XSSFWorkbook excel) throws FHIRFormatError, FileNotFoundException, IOException {
Bundle bnd = (Bundle) parseXml(fnSP());
XSSFSheet sheet = excel.createSheet(SN_SEARCH);
addSearchColumns(sheet);
int rowCount = 0;
for (BundleEntryComponent be : bnd.getEntry()) {
rowCount++;
addSearchParam(sheet, (SearchParameter) be.getResource(), rowCount);
}
}
use of org.hl7.fhir.exceptions.FHIRFormatError in project kindling by HL7.
the class SpreadSheetCreator method addOperations.
private void addOperations(XSSFWorkbook excel, XSSFSheet bindings) throws FHIRFormatError, FileNotFoundException, IOException {
ListResource list = (ListResource) parseXml(fnOperations());
list.setText(null);
XSSFSheet sheet = excel.createSheet(SN_OPERATIONS);
addOperationColumns(sheet);
int rowCount = 1;
for (ListResourceEntryComponent li : list.getEntry()) {
String ref = li.getItem().getReference();
ref = ref.substring(ref.indexOf("/") + 1);
OperationDefinition opd = (OperationDefinition) parseXml(fnOpDef(ref));
opd.setText(null);
rowCount = addOperation(sheet, bindings, opd, rowCount);
}
}
use of org.hl7.fhir.exceptions.FHIRFormatError 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.exceptions.FHIRFormatError in project kindling by HL7.
the class ResourceParser method parseResource.
private ResourceDefn parseResource(String t) throws FHIRFormatError, FileNotFoundException, IOException {
StructureDefinition sd = (StructureDefinition) parseXml("structuredefinition-" + t + ".xml");
sdList.put(sd.getUrl(), sd);
sd.setVersion(version);
ResourceDefn r = new ResourceDefn();
r.setName(sd.getName());
r.setEnteredInErrorStatus(ToolingExtensions.readStringExtension(sd, BuildExtensions.EXT_ENTERED_IN_ERROR_STATUS));
r.setStatus(StandardsStatus.fromCode(ToolingExtensions.readStringExtension(sd, ToolingExtensions.EXT_STANDARDS_STATUS)));
r.setAbstract(sd.getAbstract());
r.setInterface(ToolingExtensions.readBoolExtension(sd, BuildExtensions.EXT_RESOURCE_INTERFACE));
r.setWg(definitions.getWorkgroups().get(ToolingExtensions.readStringExtension(sd, ToolingExtensions.EXT_WORKGROUP)));
r.setFmmLevel(ToolingExtensions.readStringExtension(sd, ToolingExtensions.EXT_FMM_LEVEL));
r.setProposedOrder(ToolingExtensions.readStringExtension(sd, BuildExtensions.EXT_PROPOSED_ORDER));
r.setSecurityCategorization(SecurityCategorization.fromCode(ToolingExtensions.readStringExtension(sd, "http://hl7.org/fhir/StructureDefinition/structuredefinition-security-category")));
r.setRequirements(sd.getPurpose());
r.setDefinition(sd.getDescription());
if (sd.hasExtension(BuildExtensions.EXT_TEMPLATE)) {
String tname = BuildExtensions.readStringExtension(sd, BuildExtensions.EXT_TEMPLATE);
ResourceDefn template = definitions.getResourceByName(tname);
r.setTemplate(template.getRoot());
}
// private long timestamp; only set in regenerator...?
// todo:
// private List<InheritedMapping> inheritedMappings = new ArrayList<InheritedMapping>();
// private ElementDefn template;
// private Map<String, PointSpec> layout = new HashMap<String, PointSpec>();
ProfileUtilities pu = new ProfileUtilities(context, null, null);
r.setRoot(parseTypeDefinition(pu, sd.getDifferential().getElementFirstRep(), sd));
r.getRoot().setFmmLevel(r.getFmmLevel());
r.getRoot().setRequirements(r.getRequirements());
if (r.isAbstract()) {
r.getRoot().setAbstractType(true);
}
if (sd.hasBaseDefinition()) {
r.getRoot().getTypes().add(new TypeRef(sd.getBaseDefinition().replace("http://hl7.org/fhir/StructureDefinition/", "")));
}
return r;
}
use of org.hl7.fhir.exceptions.FHIRFormatError in project kindling by HL7.
the class ResourceParser method processProfile.
private ConstraintStructure processProfile(String rid, String igId, ImplementationGuideDefinitionResourceComponent res, WorkGroup wg) throws FHIRFormatError, FileNotFoundException, IOException {
StructureDefinition sd = (StructureDefinition) parseXml("structuredefinition-profile-" + rid + ".xml");
ImplementationGuideDefn ig = definitions.getIgs().get(BuildExtensions.readStringExtension(res, igId));
if (ig == null) {
ig = definitions.getIgs().get("core");
}
ConstraintStructure cs = new ConstraintStructure(sd, ig, wg == null ? wg(sd) : wg, null, false);
return cs;
}
Aggregations