Tutorial: ICH Guidelines Integration with CTWise API
Difficulty: Intermediate Time to Complete: 20 minutes Prerequisites: CTWise API key, familiarity with ICH guidelines
Goal
Learn how to integrate ICH (International Council for Harmonisation) guidelines into your clinical trial workflows using the CTWise API. By the end of this tutorial, you'll be able to:
- Query ICH guidelines by topic area (E, S, M, Q series)
- Cross-reference ICH with FDA regulations
- Build a compliance matrix using both sources
- Track guideline updates and revisions
Prerequisites
Before you begin, ensure you have:
- A CTWise API key (Starter tier or higher recommended)
- Understanding of ICH guideline structure (E, S, M, Q series)
- Python 3.8+ or Node.js 18+ for code examples
ICH Guideline Series Overview
| Series | Topic | Examples |
|---|---|---|
| E | Efficacy | E6 (GCP), E8 (Clinical Studies), E9 (Statistics) |
| S | Safety | S1 (Carcinogenicity), S7 (Pharmacology), S9 (Anticancer) |
| M | Multidisciplinary | M4 (CTD), M7 (Mutagenic Impurities), M10 (Bioanalytical) |
| Q | Quality | Q1-Q14 (Manufacturing, Stability, etc.) |
Step 1: List Available ICH Guidelines
First, retrieve all ICH guidelines available in CTWise:
export CTWISE_API_KEY="your-api-key-here"
export CTWISE_API_BASE="https://kj2xss9yg9.execute-api.us-east-1.amazonaws.com/dev0/v1"
curl -s "${CTWISE_API_BASE}/rules?source=ich&limit=50" \
-H "X-Api-Key: ${CTWISE_API_KEY}" | jq '.rules[] | {id, title, category}'
Expected Output:
{"id": "ich-e6-r2", "title": "ICH E6(R2) Good Clinical Practice", "category": "efficacy"}
{"id": "ich-e8-r1", "title": "ICH E8(R1) General Considerations for Clinical Studies", "category": "efficacy"}
{"id": "ich-e9-r1", "title": "ICH E9(R1) Statistical Principles for Clinical Trials", "category": "efficacy"}
{"id": "ich-s7a", "title": "ICH S7A Safety Pharmacology Studies", "category": "safety"}
...
Step 2: Query Efficacy (E-Series) Guidelines
For clinical trial design, focus on E-series guidelines:
curl -s "${CTWISE_API_BASE}/rules?source=ich&category=efficacy&limit=20" \
-H "X-Api-Key: ${CTWISE_API_KEY}" | jq .
Key E-Series Guidelines:
| Guideline | Topic | Key Requirements |
|---|---|---|
| E6(R2) | GCP | Sponsor, investigator, IRB responsibilities |
| E8(R1) | Clinical Studies | Study design principles |
| E9(R1) | Statistics | Statistical methodology, estimands |
| E10 | Choice of Control | Placebo, active control selection |
| E14 | QT/QTc | Cardiac safety evaluation |
| E17 | Multi-Regional | Multi-regional clinical trials |
Step 3: Cross-Reference ICH with FDA
A powerful CTWise feature is cross-referencing ICH guidelines with FDA regulations:
# Get ICH E6(R2) with related FDA regulations
curl -s "${CTWISE_API_BASE}/rules/ich-e6-r2" \
-H "X-Api-Key: ${CTWISE_API_KEY}" | jq '.references'
Expected Output:
{
"references": [
{"id": "fda-21cfr312", "relationship": "implements", "description": "FDA IND regulations"},
{"id": "fda-21cfr50", "relationship": "harmonized_with", "description": "FDA informed consent"},
{"id": "fda-21cfr56", "relationship": "harmonized_with", "description": "FDA IRB requirements"},
{"id": "fda-21cfr11", "relationship": "referenced_by", "description": "Electronic records"}
]
}
Step 4: Build a Compliance Matrix
Create a compliance matrix that maps ICH guidelines to FDA regulations:
import requests
import json
API_KEY = "your-api-key-here"
API_BASE = "https://kj2xss9yg9.execute-api.us-east-1.amazonaws.com/dev0/v1"
headers = {
"X-Api-Key": API_KEY,
"Content-Type": "application/json"
}
def build_compliance_matrix(ich_guidelines: list) -> dict:
"""
Build a matrix mapping ICH guidelines to FDA regulations.
Args:
ich_guidelines: List of ICH guideline IDs (e.g., ["ich-e6-r2", "ich-e8-r1"])
Returns:
Dictionary with ICH → FDA mappings
"""
matrix = {}
for guideline_id in ich_guidelines:
# Get guideline details with references
response = requests.get(
f"{API_BASE}/rules/{guideline_id}",
headers=headers
)
response.raise_for_status()
data = response.json()
# Extract FDA references
fda_refs = [
ref for ref in data.get("references", [])
if ref["id"].startswith("fda-")
]
matrix[guideline_id] = {
"title": data["title"],
"category": data["category"],
"fda_references": fda_refs,
"harmonization_status": "Full" if len(fda_refs) > 0 else "Partial"
}
return matrix
# Build matrix for key E-series guidelines
guidelines = ["ich-e6-r2", "ich-e8-r1", "ich-e9-r1", "ich-e10", "ich-e14"]
matrix = build_compliance_matrix(guidelines)
# Print matrix
print("ICH-FDA Compliance Matrix")
print("=" * 60)
for ich_id, data in matrix.items():
print(f"\n{ich_id}: {data['title']}")
print(f" Category: {data['category']}")
print(f" Harmonization: {data['harmonization_status']}")
print(f" FDA References:")
for ref in data["fda_references"]:
print(f" - {ref['id']}: {ref['description']}")
Sample Output:
ICH-FDA Compliance Matrix
============================================================
ich-e6-r2: ICH E6(R2) Good Clinical Practice
Category: efficacy
Harmonization: Full
FDA References:
- fda-21cfr312: FDA IND regulations
- fda-21cfr50: FDA informed consent
- fda-21cfr56: FDA IRB requirements
ich-e9-r1: ICH E9(R1) Statistical Principles for Clinical Trials
Category: efficacy
Harmonization: Full
FDA References:
- fda-guidance-statistical: FDA statistical guidance
Step 5: Semantic Search Across ICH and FDA
Search both sources simultaneously for a specific topic using either POST or GET methods:
POST Method (Recommended)
curl -s -X POST "${CTWISE_API_BASE}/semantic-search" \
-H "X-Api-Key: ${CTWISE_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"query": "requirements for informed consent in pediatric clinical trials",
"sources": ["ich", "fda"],
"limit": 10
}' | jq '.results[] | {id: .rule_id, title, source, score: .similarity_score}'
GET Method (Alternative)
curl -s "${CTWISE_API_BASE}/rules/search?q=informed+consent+pediatric+trials&sources=ich,fda&limit=10" \
-H "X-Api-Key: ${CTWISE_API_KEY}" | jq '.results[] | {id: .rule_id, title, source, score: .similarity_score}'
Expected Output:
{"id": "ich-e11", "title": "ICH E11 Clinical Investigation of Medicinal Products in the Pediatric Population", "source": "ich", "relevance_score": 0.94}
{"id": "fda-21cfr50-subpart-d", "title": "21 CFR 50 Subpart D - Additional Safeguards for Children", "source": "fda", "relevance_score": 0.91}
{"id": "ich-e6-r2", "title": "ICH E6(R2) Good Clinical Practice", "source": "ich", "relevance_score": 0.78}
{"id": "fda-21cfr50", "title": "21 CFR 50 - Protection of Human Subjects", "source": "fda", "relevance_score": 0.75}
Step 6: Node.js Integration Example
const axios = require('axios');
const API_KEY = process.env.CTWISE_API_KEY;
const API_BASE = 'https://kj2xss9yg9.execute-api.us-east-1.amazonaws.com/dev0/v1';
const headers = {
'X-Api-Key': API_KEY,
'Content-Type': 'application/json'
};
async function getICHGuidelines(series) {
/**
* Get ICH guidelines by series (efficacy, safety, quality, multidisciplinary)
*/
const response = await axios.get(`${API_BASE}/rules`, {
headers,
params: {
source: 'ich',
category: series,
limit: 50
}
});
return response.data;
}
async function crossReferenceWithFDA(ichGuidelineId) {
/**
* Get FDA regulations that implement or harmonize with an ICH guideline
*/
const response = await axios.get(`${API_BASE}/rules/${ichGuidelineId}`, {
headers
});
const ichRule = response.data;
const fdaReferences = ichRule.references.filter(ref => ref.id.startsWith('fda-'));
// Fetch details for each FDA reference
const fdaDetails = await Promise.all(
fdaReferences.map(async (ref) => {
const fdaResponse = await axios.get(`${API_BASE}/rules/${ref.id}`, { headers });
return {
...ref,
details: fdaResponse.data
};
})
);
return {
ich: ichRule,
fda_references: fdaDetails
};
}
// Example usage
(async () => {
// Get all efficacy guidelines
const efficacyGuidelines = await getICHGuidelines('efficacy');
console.log(`Found ${efficacyGuidelines.total} efficacy guidelines`);
// Cross-reference ICH E6(R2)
const crossRef = await crossReferenceWithFDA('ich-e6-r2');
console.log(`\nICH E6(R2) maps to ${crossRef.fda_references.length} FDA regulations`);
crossRef.fda_references.forEach(ref => {
console.log(` - ${ref.id}: ${ref.description}`);
});
})();
Use Case: Clinical Trial Compliance Checklist
Generate a compliance checklist for a Phase 3 clinical trial:
def generate_trial_compliance_checklist(trial_phase: str = "3") -> list:
"""
Generate compliance checklist based on ICH and FDA requirements.
"""
# Search for phase-specific requirements using semantic search
response = requests.post(
f"{API_BASE}/semantic-search",
headers=headers,
json={
"query": f"Phase {trial_phase} clinical trial requirements",
"sources": ["ich", "fda"],
"limit": 20
}
)
rules = response.json()["results"]
checklist = []
for rule in rules:
checklist.append({
"requirement": rule["title"],
"source": rule["source"].upper(),
"rule_id": rule["id"],
"category": rule.get("category", "general"),
"completed": False
})
return checklist
# Generate checklist
checklist = generate_trial_compliance_checklist("3")
print("Phase 3 Clinical Trial Compliance Checklist")
print("=" * 50)
for i, item in enumerate(checklist, 1):
print(f"{i}. [{' '}] {item['requirement']}")
print(f" Source: {item['source']} | Rule: {item['rule_id']}")
Troubleshooting
| Error | Cause | Solution |
|---|---|---|
| Empty ICH results | ICH not in your sources | Verify ICH source is available for your tier |
| Missing cross-references | Rule hasn't been mapped | Check rule's last_updated date |
| Slow response | Large result set | Use pagination, reduce limit |
| Rate limit errors | Too many requests | Implement exponential backoff |
Next Steps
- Query FDA Rules Tutorial - Deep dive into FDA regulations
- Rule Updates Monitoring - Set up change alerts
- SDK Documentation - Use our Python and JavaScript SDKs
Additional Resources
Feedback
Found an issue with this tutorial? Submit feedback or contact support@orchestraprime.ai.