SharpRevenue Reports as HTML or PDF
Every SharpRevenue result can come back as a finished report instead of JSON: a self-contained HTML page you can show straight inside your system, or a PDF you can save to the patient's chart. Use this when your system cannot read JSON, or when you simply want a report without building one.
The report is the full result: patient and demographic verification, each payer's eligibility and coverage discovery, deductibles and out-of-pocket amounts, copays and coinsurance by service type (the 271 benefits), Medicare, Medicaid and managed-care detail, guarantor, and MBI finder. Anything the payer did not return is left out rather than shown blank. The raw X12 271 is never included.
Choosing the format
Add responseFormat to the request. Leave it out and you get JSON exactly as before, so existing integrations are unaffected.
responseFormat | You get |
|---|---|
Json (default) | The normal JSON response. |
JsonWithHtml | The normal JSON, plus the HTML page as a string in resultHtml. |
Html | The HTML page itself (Content-Type: text/html). No JSON. |
JsonWithPdf | The normal JSON, plus the PDF as a base64 string in resultPdf. |
Pdf | The PDF itself (Content-Type: application/pdf). No JSON. |
The value can be sent by name ("Html") or number. An unrecognised name is rejected with 400 Bad Request.
On a new request
RunSharpRevenue takes it in the request body:
POST /api/SharpRevenue/v1/RunSharpRevenue
Content-Type: application/json
Authorization: Bearer <token>
{
"practiceName": "My DEMO Account",
"npi": "1234567890",
"patientFirstName": "Heath",
"patientLastName": "Varner",
"productsToRun": [1],
"responseFormat": "Html"
}
PostEligibilityRequestFile (X12 upload) and CheckTransactionStatus take it as a query parameter instead, because their bodies are not a SharpRevenue request: ?format=Html.
On a result you already have
To get a report for a check that has already run, fetch it by its claimRevResultId. This draws the report from the stored result; it does not run the check again or contact the payer.
GET /api/SharpRevenue/v1/GetSharpRevenueOutput?claimRevId={claimRevResultId}&format=Pdf
Authorization: Bearer <token>
If you only kept your own transaction id, pass originatingSystemId={yourId} instead of claimRevId. Results are limited to the accounts your credentials can access.
When there is no JSON: the response headers
With Html or Pdf there is no JSON body, but you still need to know whether the result is final. The same values travel as response headers:
| Header | Meaning |
|---|---|
X-ClaimRev-Result-Id | The claimRevResultId. Keep it to fetch the report again later. |
X-ClaimRev-Status | The vendor status, for example Complete or Pending. |
X-ClaimRev-Retry-Later | true when one or more payers are still pending. Check again shortly. |
X-ClaimRev-Fatal-Error | true when the check failed. The page or PDF explains why. |
The same information is printed at the top of the report, so a person reading it can tell a pending result from a final one.
Polling for a pending result: when X-ClaimRev-Retry-Later is true, call GetSharpRevenueOutput again later with the X-ClaimRev-Result-Id value and the same format, until it reads false.
A failed check still returns 200 with a report describing the error, so there is always something to display.
Using the HTML
The page is self-contained: styles are inline, and there are no scripts, external fonts or remote images. It can be shown in an iframe or stored as-is, and it prints cleanly.
Using JsonWithPdf
resultPdf is base64. Decode it to get the PDF file:
var bytes = Convert.FromBase64String(response.ResultPdf);
File.WriteAllBytes("eligibility.pdf", bytes);
The QR code
The HTML and PDF end with a QR code and a clickable link to the result. By default they open the result in the ClaimRev portal, which still requires the reader to sign in and have access to the account. Two optional request fields change this:
| Field | Effect |
|---|---|
includeQrCode | true or false decides for this request. Leave it out and the practice's Show QR code setting decides (on unless the practice has turned it off). |
qrCodeUrl | Point the QR code and link at your own page instead, for example the patient's visit in your EMR. Must be an absolute https or http address of up to 2000 characters. |
{
"responseFormat": "Pdf",
"qrCodeUrl": "https://emr.example.com/patients/42/visits/7"
}
- If
qrCodeUrlis set but is not a usable address, the report has no QR code, rather than one pointing somewhere you did not intend. - Both fields are saved with the request, so fetching the report again later through
GetSharpRevenueOutputdraws the same QR code. - There is no QR code on a failed result, since there is nothing to open.
The practice-wide setting is on the practice screen in the ClaimRev portal, under Settings: "Show QR code on HTML and PDF eligibility reports". Changing it applies to every report drawn from then on, including reports for earlier results.
In the ClaimRev portal
Quick Check and the eligibility result screen both have Open as HTML and Open as PDF buttons. They open exactly what the API returns, which makes them a quick way to preview the report before you integrate.
Related
- SharpRevenue Tools: API Testing Guide for running checks and the test-environment mock data.
- SharpRevenue Bulk Eligibility and Queued Requests for batches.