use of org.hl7.fhir.definitions.model.Operation.OperationExample in project kindling by HL7.
the class ResourceParser method convertOperation.
private Operation convertOperation(OperationDefinition src) throws FileNotFoundException, FHIRException, IOException, Exception {
List<OperationExample> examples = new ArrayList<>();
List<OperationExample> examples2 = new ArrayList<>();
for (Extension ex : src.getExtensionsByUrl(BuildExtensions.EXT_OP_EXAMPLE)) {
if ("2".equals(ex.getExtensionString(BuildExtensions.EXT_OP_EXAMPLE_LIST))) {
processExample(examples2, ex.getExtensionString(BuildExtensions.EXT_OP_EXAMPLE_CONTENT), "true".equals(ex.getExtensionString(BuildExtensions.EXT_OP_EXAMPLE_RESPONSE)));
} else {
processExample(examples, ex.getExtensionString(BuildExtensions.EXT_OP_EXAMPLE_CONTENT), "true".equals(ex.getExtensionString(BuildExtensions.EXT_OP_EXAMPLE_RESPONSE)));
}
}
Operation op = new Operation(src.getName(), src.getSystem(), src.getType(), src.getInstance(), src.getKind().toCode(), src.getTitle(), src.getDescription(), BuildExtensions.readStringExtension(src, BuildExtensions.EXT_FOOTER), examples, !src.getAffectsState());
op.getExamples2().addAll(examples2);
op.setResource(src);
op.setStandardsStatus(StandardsStatus.fromCode(BuildExtensions.readStringExtension(src, BuildExtensions.EXT_STANDARDS_STATUS)));
op.setFmm(BuildExtensions.readStringExtension(src, BuildExtensions.EXT_FMM_LEVEL));
op.setFooter2(BuildExtensions.readStringExtension(src, BuildExtensions.EXT_FOOTER2));
for (OperationDefinitionParameterComponent psrc : src.getParameter()) {
op.getParameters().add(convertOperationParameter(psrc, false));
}
return op;
}
Aggregations