I actually doubt that will work, this code implies you only get back active orders for sub classes, if even you don’t specify a type and fetch all orders, it appears like discontinuation orders are still not included via rest, this is because discontinuation orders automatically auto expire as they get saved as seen here
Note that there is a difference between discontinuation(DC) and discontinued orders, the difference being the action field. By default the API never returns discontinued nor discontinuation orders and thus REST also doesn’t really do so. The assumption is that anyone building a clinician facing or POC application should never be requesting for discontinued/expired and in fact voided orders just like that because it would be pointless.
It’s worth mentioning that a user might wish to view a single patient’s order history or might wish to migrate orders say from one openmrs DB to another, the API has 2 service methods that let you achieve these use cases, to view a patient’s order history there is OrderService.getOrderHistoryByConcept which pretty much can return discontinued/expired, discontinuation and voided orders, there’s another one OrderService.getOrders(OrderType orderType, List patients, List concepts, List orderers, List encounters) for migration purposes that would also include all orders regardless if they’re discontinued/voided/expired, we intentionally didn’t expose these via REST until somebody requested for them.