Skip to main content
This page contains complete API usage examples for different clinical scenarios with the Codify ICD-10 medical coding API.

Example 1: Simple diabetes case

Use case

Process a clinical note about a diabetes patient and extract ICD-10 codes with confidence scores.

Input text

Complete request

Response

Interpretation:
  • E11.9: Type 2 diabetes mellitus without complications (95.2% confidence)
  • Z79.84: Long term use of oral hypoglycemic drugs (98.1% confidence)
  • The AI correctly identified controlled diabetes and discarded hyperglycemia code due to stable glucose levels

Example 2: Emergency pneumonia case

Use case

Process an emergency department note for a patient with pneumonia and extract ICD-10 codes.

Input text

Complete request

Response

Interpretation:
  • J18.1: Lobar pneumonia (96.8% confidence) - Primary diagnosis
  • R50.9: Fever (91.5% confidence) - Significant presenting symptom
  • The AI correctly selected lobar pneumonia over unspecified bacterial pneumonia based on radiological evidence

Example 3: PDF file processing

Use case

Process a PDF medical report and extract ICD-10 codes.

Complete request with PDF encoding

Response

The response format is identical to text input, containing final_code_assessments, discarded_code_assessments, and run_id.

Example 4: FHIR bundle extraction

Use case

Process clinical data already structured in FHIR (Fast Healthcare Interoperability Resources) format and extract simplified diagnostic codes or aggregated information.
The API can also receive FHIR JSON as input to extract/transform specific information.

Input (FHIR Bundle as JSON)

JSON Schema for summary extraction

Request

Response

FHIR use cases:
  • Simplify complex FHIR bundles into readable reports
  • Extract specific codes (ICD-10, SNOMED, LOINC) from FHIR resources
  • Generate narrative summaries from structured FHIR data
  • Convert between FHIR/HL7 versions or normalize codes

Example 5: Structured clinical note extraction

Use case

Extract structured fields from a medical consultation (reason, current illness, treatment plan, vital signs, etc.) for automatic EHR documentation.

Complete request

Response


Example 6: Oncology registry extraction

Use case

Automatically populate an oncology registry with data extracted from clinical notes.

Complete request

Response


Example 7: Medication extraction

Use case

Extract prescribed medications with pharmacy system codes.

Complete request

Response


Example 8: Batch processing multiple notes

Use case

Process multiple clinical notes in parallel for efficient bulk coding.

Complete request

Output


Best practices from examples

1. Use tracking headers

Always include x-doctor and x-patient headers for better audit trails:

2. Filter by confidence threshold

Review codes with high confidence first:

3. Review discarded codes

Understand the AI’s decision-making process:

4. Store run_id for debugging

Always save the run_id for troubleshooting:

5. Handle errors gracefully


Next steps

Error Handling

Learn about error codes and retry strategies

Request Structure

Complete field reference

Authentication

API tokens and security

Quick Start

Get started in 5 minutes