COMPLETED, or generation ended in FAILED or ABORTED. Generate can also fail when the encounter start date is not today, even if ingestion already succeeded.
You need a Suki Token (sdp_suki_token) for upload, generate, status, and retrieve. A Partner Token alone is not enough.
Common causes
- Retrieving the summary before generation status is
COMPLETED. - Triggering generation before CKG ingestion status is
COMPLETED. - Generating against an encounter whose start date is not today. Generation can fail with code
5(failed to generate patient summary for fhir encounter) even when ingestion isCOMPLETEDand the FHIR IDs match. - Keeping the poll loop running after
FAILEDorABORTED. - Treating a 403
permission_deniedas empty content.
Fix
1
Finish CKG Ingestion First
Upload FHIR data, then poll ingestion status until
COMPLETED. Stop on FAILED or ARCHIVED.2
Use Today's Encounter
Confirm the encounter start date in your FHIR data is for the current day. Older test encounters can fail generate even when ingestion succeeded and the IDs are correct. Update the date, re-ingest if needed, then generate again.
3
Generate, Then Poll Job Status
Call generate, then poll encounter or job status until
COMPLETED. Status values include READY, RUNNING, COMPLETED, FAILED, and ABORTED. Stop on FAILED or ABORTED.4
Retrieve Only After COMPLETED
Call full or pre-visit summary endpoints only when generation status is
COMPLETED. Use patient_summary_id from generation, or the fhir_encounter_id and fhir_practitioner_id pair you used.5
If You Get 403
Fix organization access. See 403 permission_denied, insufficient_scope, or sbac_denied.
Order from the Patient Summary quickstart: upload and poll ingestion, Login when needed, generate, poll generation status, then retrieve.