With HAPI you can add custom search parameters. HAPI's documentation on this can be found here. While it is unfortunate that procedure
and diagnosis
are not part of the default search params for a claim, it was easy enough to add what I needed.
As an example, I was able to add a path from item's productOrService
codes. Here is an example of the Search Parameter resource I created.
{
"resourceType": "SearchParameter",
"url": "http://example.org/fhir/SearchParameter/claim-item-productOrService",
"version": "1.0",
"name": "ClaimItemProductOrService",
"status": "active",
"description": "Search Claims by productOrService field in Claim items.",
"code": "product-or-service",
"base": ["Claim"],
"type": "token",
"expression": "Claim.item.productOrService",
"xpath": "f:Claim/f:item/f:productOrService",
"xpathUsage": "normal"
}
With that, you can now perform searches like https://base_fhir_server_url/Claim?product-or-service=CPT|99454
for example.