Fetching AGP report status
Client can check the status of the AGP report generation by sending a GET request to the endpoint returned by the report generation request. For example:
curl -sS "https://${server}/fhir/r5/api/DiagnosticReport/482c9449-add0-4312-a6ba-07831d5ffa5b/$status" \
-H "client_id: ${client_id}" \
-H "client_secret: ${client_secret}" \
-H "org_id: ${org_id}" \
-H "certificate: ${certificate}" | jq
The above request checks the status of the AGP report generation using the Content-Location
URL returned by the initial report generation request. This process follows the Asynchronous Interaction Request Pattern.
The client should poll for the status of the AGP report generation until the server responds with HTTP 200 OK
status code, which indicates that the report generation is completed. The recommended polling interval is as specified by the Retry-After
header in the response.
Response
Report generation Pending
The server respond with HTTP 202 Accepted
status code if the Report generation is still in-progress
.
Report generation completed successfully
In accordance with the Asynchronous Interaction Request Pattern, when a status request is made for a report generation operation that succeeded, the server responds with an HTTP 200 OK
status code and includes a Bundle resource in the payload.
The first entry in the Bundle represents the outcome, with
200 OK
in itsresponse.status
field.The second entry in the Bundle is a
DiagnosticReport
resource that contains the details of the AGP report. This entry also includes a list ofObservation
resources as contained resources.Example of a successful report generation completed with adequate data:
{ "resourceType": "Bundle", "id": "rdc-Bundle-response-AGP-report", "type": "batch-response", "entry": [ { "response": { "status": "200 OK" } }, { "fullUrl": "urn:uuid:550e8400-e29b-41d4-a716-446655440000", "resource": { "resourceType": "DiagnosticReport", "id": "550e8400-e29b-41d4-a716-446655440000", "contained": [ { "resourceType": "Observation", "id": "4979d6cc-2102-4e85-b87e-1d82d39fd6db", "meta": { "profile": [ "https://roche.com/fhir/iop/StructureDefinition/rdc-Observation" ] }, "code": { "coding": [ { "system": "http://loinc.org", "code": "97507-8", "display": "Average glucose [Mass/ volume] in Interstitial fluid during Reporting Period" } ] }, "status": "final", "subject": { "reference": "Patient/itBKL38V0PNndc1ESu3rdl05fNeAqoc" }, "effectiveDateTime": "01/13/2025 10:48:23", "valueQuantity": { "value": 173, "unit": "mg/dL" } }, { "resourceType": "Observation", "id": "f01d7558-afe7-4de6-8e02-c6946c407cd3", "meta": { "profile": [ "https://roche.com/fhir/iop/StructureDefinition/rdc-Observation" ] }, "code": { "coding": [ { "system": "http://loinc.org", "code": "97504-5", "display": "Percent sensor usage" } ] }, "status": "final", "subject": { "reference": "Patient/itBKL38V0PNndc1ESu3rdl05fNeAqoc" }, "effectiveDateTime": "01/13/2025 10:48:23", "valueQuantity": { "value": 99, "unit": "%" } }, { "resourceType": "Observation", "id": "0619c110-edee-487b-b884-de3895303a04", "meta": { "profile": [ "https://roche.com/fhir/iop/StructureDefinition/rdc-Observation" ] }, "code": { "coding": [ { "system": "http://loinc.org", "code": "97506-0", "display": "Glucose management indicator" } ] }, "status": "final", "subject": { "reference": "Patient/itBKL38V0PNndc1ESu3rdl05fNeAqoc" }, "effectiveDateTime": "01/13/2025 10:48:23", "valueQuantity": { "value": 7.5, "unit": "%" } }, { "resourceType": "Observation", "id": "8b8e3c3d-c22f-4816-82ca-f4b29c9daf0a", "meta": { "profile": [ "https://roche.com/fhir/iop/StructureDefinition/rdc-Observation" ] }, "code": { "coding": [ { "system": "https://roche.com/fhir/iop/cs", "code": "CGM_Glycemic_Variability_Reporting_Period", "display": "CGM Glycemic Variability (%GV) during reporting period" } ] }, "status": "final", "subject": { "reference": "Patient/itBKL38V0PNndc1ESu3rdl05fNeAqoc" }, "effectiveDateTime": "01/13/2025 10:48:23", "valueQuantity": { "value": 46, "unit": "%" } }, { "resourceType": "Observation", "id": "b077f04d-8868-49e4-83e0-b0022d488e15", "meta": { "profile": [ "https://roche.com/fhir/iop/StructureDefinition/rdc-Observation" ] }, "code": { "coding": [ { "system": "http://loinc.org", "code": "97510-2", "display": "Glucose measurements in range out of Total glucose measurements during reporting period" } ] }, "status": "final", "subject": { "reference": "Patient/itBKL38V0PNndc1ESu3rdl05fNeAqoc" }, "effectiveDateTime": "01/13/2025 10:48:23", "valueQuantity": { "value": 32, "unit": "%" } }, { "resourceType": "Observation", "id": "bedde59e-8fa2-4cb4-852a-1826cd769818", "meta": { "profile": [ "https://roche.com/fhir/iop/StructureDefinition/rdc-Observation" ] }, "code": { "coding": [ { "system": "https://roche.com/fhir/iop/cs", "code": "CGM_Time_Above_Range_TARVH_Reporting_Period", "display": "CGM Time above range, very high (TAR-VH), % of readings and time >250 mg/dL (>13.9 mmol/L), during reporting period" } ] }, "status": "final", "subject": { "reference": "Patient/itBKL38V0PNndc1ESu3rdl05fNeAqoc" }, "effectiveDateTime": "01/13/2025 10:48:23", "valueQuantity": { "value": 16, "unit": "%" } }, { "resourceType": "Observation", "id": "4a5a0c1a-facd-4843-a284-3fa36e749b4f", "meta": { "profile": [ "https://roche.com/fhir/iop/StructureDefinition/rdc-Observation" ] }, "code": { "coding": [ { "system": "https://roche.com/fhir/iop/cs", "code": "CGM_Time_Above_Range_TARH_Reporting_Period", "display": "CGM Time above range, high (TAR-H), % of readings and time 181–250 mg/ dL (10.1–13.9 mmol/L), during reporting period" } ] }, "status": "final", "subject": { "reference": "Patient/itBKL38V0PNndc1ESu3rdl05fNeAqoc" }, "effectiveDateTime": "01/13/2025 10:48:23", "valueQuantity": { "value": 40, "unit": "%" } }, { "resourceType": "Observation", "id": "bd11630a-469e-47fe-a27a-fae54233f09c", "meta": { "profile": [ "https://roche.com/fhir/iop/StructureDefinition/rdc-Observation" ] }, "code": { "coding": [ { "system": "https://roche.com/fhir/iop/cs", "code": "CGM_Time_Below_Range_TBRVL_Reporting_Period", "display": "CGM Time below range, very low (TBR-VL), % of readings and time <54 mg/dL (<3.0 mmol/L), during reporting period" } ] }, "status": "final", "subject": { "reference": "Patient/itBKL38V0PNndc1ESu3rdl05fNeAqoc" }, "effectiveDateTime": "01/13/2025 10:48:23", "valueQuantity": { "value": 0, "unit": "%" } }, { "resourceType": "Observation", "id": "a445a340-e3fd-4a96-bb71-b5acc2f43a44", "meta": { "profile": [ "https://roche.com/fhir/iop/StructureDefinition/rdc-Observation" ] }, "code": { "coding": [ { "system": "https://roche.com/fhir/iop/cs", "code": "CGM_Time_Below_Range_TBRL_Reporting_Period", "display": "CGM Time below range, low (TBR-L), % of readings and time 54–69 mg/dL (3.0–3.8 mmol/L), during reporting period" } ] }, "status": "final", "subject": { "reference": "Patient/itBKL38V0PNndc1ESu3rdl05fNeAqoc" }, "effectiveDateTime": "01/13/2025 10:48:23", "valueQuantity": { "value": 12, "unit": "%" } } ], "result": [ { "reference": "#4979d6cc-2102-4e85-b87e-1d82d39fd6db" }, { "reference": "#f01d7558-afe7-4de6-8e02-c6946c407cd3" }, { "reference": "#0619c110-edee-487b-b884-de3895303a04" }, { "reference": "#8b8e3c3d-c22f-4816-82ca-f4b29c9daf0a" }, { "reference": "#b077f04d-8868-49e4-83e0-b0022d488e15" }, { "reference": "#bedde59e-8fa2-4cb4-852a-1826cd769818" }, { "reference": "#4a5a0c1a-facd-4843-a284-3fa36e749b4f" }, { "reference": "#bd11630a-469e-47fe-a27a-fae54233f09c" }, { "reference": "#a445a340-e3fd-4a96-bb71-b5acc2f43a44" } ], "status": "final", "code": { "coding": [ { "system": "https://roche.com/fhir/iop/cs", "code": "AGP_Report", "display": "CGM Ambulatory Glucose Profile (AGP) During Reporting Period" } ] }, "subject": { "reference": "Patient/itBKL38V0PNndc1ESu3rdl05fNeAqoc" }, "effectivePeriod": { "start": "09/01/2025 00:00:00", "end": "09/14/2025 23:59:59" }, "performer": [ { "reference": "Organization/3156161" } ], "presentedForm": [ { "contentType": "application/pdf", "url": "https://devus-emr-integration-data-store-s3.s3.amazonaws.com/in/reports/AGP/EMR/PDF/47e9a931-fce3-4962-b8a7-4da962fa7dd6-0.pdf?X-Amz-Security-Token=IQoJb3JpZ2luX2VjEAMaCXVzLWVhc3QtMSJHMEUCIQCujO8JXi3uaLQ0JpRD3G3KN2yVnaPlGf2bulrTGyFALwIgdUmM2fazR5ULPAMWQ309d2VIYxHc7e5r81KcAW5CLt8qugII7P%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FARAFGgwwMTkzNjQ0ODEwOTEiDF1gylT%2FUfcyiBPkMyqOAmeW%2FffXBmNwp17jkfhGDfs1nGXWAFJZD1ij9mRv%2FLsKwJF3TA7lK6FVDgfddumLsEIv9fMNWHF%2FSzQPTWKZtnDM7zyA%2BqjbiuWj4JI%2BDC7mH%2B2foyRbOu5RG3iutwi3aiok6hJ9YCx%2FTL7Fzmiul6bAkqseyEafj%2FTPb6H3YiVedue1yVFo4LL%2BkSC%2BTNT0ug4mdJGln1hGUr1gGErv5Y%2F6Svbh4pPfPl3YaCTnSRY4EXlqsMfk7yUvFtjyGeyPHIRk8uBGpeifEgM7mld5GisAWPmdtDykCTao8RYKRdIpuqSOCMUUe0GGrd4ZDjCTjr48xMiv8Ckw5MfzfAqLLZxVGOH%2Bo9mSonQ3yvcpPzDd1ZO8BjqdAREWXW0mmyMxMxQCkpOTaDwFd4ttefO6wspCtZT2XsU21q%2BVI2SCDNlddvisjTr4o2W0nqw00TldjJO3YqzmrOnpUkuw78T9YIpcN3Mb2A%2Bo%2BkIfLQnWQ%2FAc8v9HN392Z%2BPwdSg%2BaMTuCgEzO1k7dtNr%2FQkenUlH7d8cPWyOa4daWB3ze0OfKLLw6rg9yyefImoTVPIwwE0DXyJoGqE%3D&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20250113T104855Z&X-Amz-SignedHeaders=host&X-Amz-Credential=ASIAQJARWRBB5WEBXNZ5%2F20250113%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Expires=1800&X-Amz-Signature=25f9725b4d2ff7e49e518f35ac2c0b9398b03b02b4a6adbe53cdf543219263df", "title": "AGP-Report", "creation": "01/13/2025 10:48:23" } ] }, "response": { "status": "200 OK", "location": "DiagnosticReport/550e8400-e29b-41d4-a716-446655440000" } } ] }
- If the patient does not have sufficient data to generate an AGP report, the server responds with an HTTP 404 NOT_FOUND status code and includes a Bundle resource in the payload.
- The payload contains a report without data. Example of a successful report generation completed with insufficient data:
{ "resourceType": "Bundle", "id": "rdc-Bundle-response-AGP-report-not-found", "type": "batch-response", "entry": [ { "response": { "status": "404 NOT_FOUND", "outcome": { "resourceType": "OperationOutcome", "issue": [ { "severity": "error", "code": "processing", "diagnostics": "Report could not be generated due to insufficient data." } ] } } }, { "fullUrl": "urn:uuid:550e8400-e29b-41d4-a716-446655450000", "resource": { "resourceType": "DiagnosticReport", "id": "550e8400-e29b-41d4-a716-446655450000", "status": "final", "code": { "coding": [ { "system": "https://roche.com/fhir/iop/cs", "code": "AGP_Report", "display": "CGM Ambulatory Glucose Profile (AGP) During Reporting Period" } ] }, "subject": { "reference": "Patient/123" }, "effectivePeriod": { "start": "05/23/2011 00:00:00", "end": "05/27/2011 23:59:59" }, "performer": [ { "reference": "Organization/org1234" } ], "presentedForm": [ { "contentType": "application/pdf", "url": "https://emr-integration-data-store-s3.s3.amazonaws.com/in/reports/AGP/EMR/PDF/08cbb4b5-5a58-457c-8a7f-da7e001071db-0.pdf?X-Amz-Security-Token=7Y4mB7WPG73gP5Ftn3evL0%2BogqgA%2F%2FWayx3bfrwIq8vbO%2FFOVRcpV5kMjKVZa81w%3D%3D&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20241211T070308Z&X-Amz-SignedHeaders=host&X-Amz-Credential=ASIAQJARWRBBZZUKPMD3%2F20241211%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Expires=1800&X-Amz-Signature=0461cb4f4e200bec04b79918c20fae45bdc6e52f47990f7805f99877634b4622", "title": "AGP-Report", "creation": "12/09/2024 05:27:12" } ] }, "response": { "status": "200 OK", "location": "DiagnosticReport/550e8400-e29b-41d4-a716-446655450000" } } ] }
Report generation completed with failure
In accordance with the Asynchronous Interaction Request Pattern, when a status request is made for a report generation operation that failed, the server also responds with an HTTP 200 OK
status code (indicated that the status was successfully returned) and includes a Bundle resource in the payload. The Bundle has a single entry that represents the outcome in its response
field. The details of the error are provided in the response.status
and response.outcome
subfields.
This example illustrates a situation where the report generation process fails. The server returns a 500 INTERNAL_SERVER_ERROR status code along with an OperationOutcome resource detailing the error. The payload includes a Bundle that does not contain a PDF.
{ "resourceType": "Bundle", "id": "rdc-Bundle-response-AGP-report-internal-server-error", "type": "batch-response", "entry": [ { "response": { "status": "500 INTERNAL_SERVER_ERROR", "outcome": { "resourceType": "OperationOutcome", "issue": [ { "severity": "error", "code": "processing", "diagnostics": "Report could not be generated." } ] } } }, { "fullUrl": "urn:uuid:550e8400-e29b-41d4-a716-446655430000", "resource": { "resourceType": "DiagnosticReport", "id": "550e8400-e29b-41d4-a716-446655430000", "status": "final", "code": { "coding": [ { "system": "https://roche.com/fhir/iop/cs", "code": "AGP_Report", "display": "CGM Ambulatory Glucose Profile (AGP) During Reporting Period" } ] }, "subject": { "reference": "Patient/123" }, "effectivePeriod": { "start": "01/01/2024 00:00:00", "end": "02/28/2024 00:00:00" }, "performer": [ { "reference": "Organization/org1234" } ] }, "response": { "status": "200 OK", "location": "DiagnosticReport/550e8400-e29b-41d4-a716-446655430000" } } ] }
Report generation status request processing failed.
If there is an error while processing the status request, the server returns an OperationOutcome resource. Here is an example of an error response:
{ "resourceType": "OperationOutcome", "issue": [ { "severity": "error", "code": "processing", "diagnostics": "Unable to check report generation status." } ] }