Enterprise Integration — Quick Reference

Common Interview Questions

Q: A CDS Hook response is timing out. What are the likely causes? (1) FHIR reads in series instead of parallel — fix with asyncio.gather. (2) AI inference too slow — add 4.5s timeout and return empty cards. (3) No FHIR prefetch configured — EHR makes extra round-trip on every hook call. Always configure prefetch for the FHIR resources the hook needs.

Q: A Kafka consumer is processing duplicate events and writing duplicate AI documents to the EHR. What's the root cause? enable<em>auto</em>commit=True commits the offset before processing. If the consumer crashes between commit and writing to EHR, the event is committed (won't be retried) but the write didn't happen. The reverse — commit after processing — means crashed consumers will reprocess. Fix: manual commit after successful processing + idempotency check (event_id in dedup cache).

Q: What FHIR scopes would you request for a CDS Hooks service? Only the specific resource types the hook reads: Patient.read, Encounter.read, Condition.read, MedicationRequest.read, Observation.read, AllergyIntolerance.read — all as system/ scopes for backend service auth. Never system/*.read. Document write scope only if the hook writes back to the EHR.