This chapter covers comprehensive details on CDSS topics including architecture, integration, guidelines, drug safety, diagnostics, data standards, alert optimization, and implementation best practices following WIA-MED-015 standards.
Implementation requires careful attention to evidence-based medicine, interoperability standards (HL7 FHIR, SNOMED CT, LOINC), and user-centered design principles. Systems must balance safety alerts with usability to prevent alert fatigue while maintaining clinical effectiveness.
弘益人間 · Benefit All Humanity
© 2025 WIA
# Chapter 4: Clinical Decision Support API Interface
## Service APIs and Integration Patterns
### 4.1 CDSS API Architecture
The WIA-CLINICAL-DECISION-SUPPORT standard defines comprehensive APIs for integrating clinical decision support into healthcare workflows. These APIs support real-time decision support, asynchronous analysis, and bidirectional communication with clinical systems.
```typescript
// CDSS API Architecture Definition
interface CDSSAPIArchitecture {
version: '1.0.0';
apiStyles: {
rest: {
description: 'RESTful APIs for synchronous operations';
useCases: ['Point-of-care queries', 'Alert processing', 'Configuration'];
};
cdsHooks: {
description: 'HL7 CDS Hooks for EHR integration';
useCases: ['Order entry support', 'Patient chart review'];
};
fhir: {
description: 'FHIR-native operations';
useCases: ['Knowledge artifacts', 'Clinical data access'];
};
graphql: {
description: 'GraphQL for flexible queries';
useCases: ['Dashboard data', 'Complex aggregations'];
};
streaming: {
description: 'Real-time event streaming';
useCases: ['Continuous monitoring', 'Early warning systems'];
};
};
authentication: {
oauth2: 'Primary authentication mechanism';
smartOnFhir: 'SMART on FHIR for EHR launch';
mtls: 'Mutual TLS for service-to-service';
apiKeys: 'For backend service integration';
};
rateLimit: {
standard: '1000 requests/minute';
burst: '100 requests/second';
premium: '10000 requests/minute';
};
}
```
### 4.2 Core CDSS REST API
```typescript
// Core CDSS API Specification
interface CDSSRestAPI {
baseUrl: 'https://api.cdss.wia.org/v1';
endpoints: {
recommendations: RecommendationEndpoints;
alerts: AlertEndpoints;
knowledge: KnowledgeEndpoints;
analytics: AnalyticsEndpoints;
audit: AuditEndpoints;
};
}
// Recommendation API Endpoints
interface RecommendationEndpoints {
// Get clinical recommendations
getRecommendation: {
method: 'POST';
path: '/recommendations';
description: 'Request clinical decision support recommendation';
};
// Get recommendation by ID
getRecommendationById: {
method: 'GET';
path: '/recommendations/{recommendationId}';
description: 'Retrieve a specific recommendation';
};
// Update recommendation status
updateRecommendationStatus: {
method: 'PATCH';
path: '/recommendations/{recommendationId}/status';
description: 'Record action taken on recommendation';
};
}
// Recommendation Request
interface RecommendationRequest {
// Patient identification
patient: {
id: string;
identifiers?: Identifier[];
};
// Clinical context
context: {
encounterId?: string;
encounterType?: string;
department?: string;
careTeam?: Reference[];
urgency: 'ROUTINE' | 'URGENT' | 'EMERGENT';
};
// What kind of support is needed
query: {
type: QueryType;
focus?: CodeableConcept;
additionalContext?: string;
};
// User making the request
requestor: {
userId: string;
role: string;
specialty?: string;
};
// Data to include
dataScope?: {
includeMedications: boolean;
includeProblems: boolean;
includeAllergies: boolean;
includeLabs: boolean;
includeVitals: boolean;
labLookbackDays?: number;
vitalLookbackHours?: number;
};
// Response preferences
preferences?: {
explanationLevel: 'BRIEF' | 'STANDARD' | 'DETAILED';
maxRecommendations?: number;
includeAlternatives: boolean;
includeReferences: boolean;
};
}
type QueryType =
| 'DIAGNOSIS_DIFFERENTIAL'
| 'TREATMENT_OPTIONS'
| 'DRUG_SELECTION'
| 'DOSING_RECOMMENDATION'
| 'SCREENING_DUE'
| 'RISK_ASSESSMENT'
| 'LAB_INTERPRETATION'
| 'IMAGING_INTERPRETATION'
| 'GUIDELINE_COMPLIANCE'
| 'COMPREHENSIVE_REVIEW';
// Recommendation Response
interface RecommendationResponse {
recommendationId: string;
status: 'COMPLETE' | 'PARTIAL' | 'ERROR';
timestamp: string;
// Query echo
query: {
type: QueryType;
focus?: CodeableConcept;
};
// The recommendations
recommendations: Recommendation[];
// Overall confidence
confidence: {
score: number; // 0-1
level: 'HIGH' | 'MEDIUM' | 'LOW';
factors: ConfidenceFactor[];
};
// Data quality assessment
dataQuality: {
completeness: number;
timeliness: number;
missingCriticalData?: string[];
};
// Explanation
explanation: {
summary: string;
reasoning?: string;
keyFactors: string[];
};
// References
references?: Reference[];
// Warnings/caveats
warnings?: Warning[];
// Validity
validUntil: string;
// Links
_links: {
self: string;
patient: string;
feedback: string;
};
}
interface Recommendation {
id: string;
rank: number;
type: RecommendationType;
// What is recommended
action: {
description: string;
code?: CodeableConcept;
resource?: Resource; // FHIR resource (e.g., MedicationRequest)
};
// Strength
strength: 'STRONG' | 'MODERATE' | 'WEAK' | 'CONDITIONAL';
urgency: 'IMMEDIATE' | 'WITHIN_HOURS' | 'WITHIN_DAYS' | 'ROUTINE';
// Rationale
rationale: string;
keyEvidence: string[];
// Evidence level
evidenceLevel: {
grade: 'A' | 'B' | 'C' | 'D' | 'I';
description: string;
};
// Contraindications (if any)
contraindications?: string[];
// Monitoring
monitoring?: {
parameters: string[];
frequency: string;
duration: string;
};
// Alternatives
alternatives?: Alternative[];
}
// CDSS API Implementation
class CDSSAPIService {
private recommendationEngine: RecommendationEngine;
private dataService: PatientDataService;
private auditService: AuditService;
@Post('/recommendations')
@UseGuards(AuthGuard, RateLimitGuard)
@ApiOperation({ summary: 'Get clinical recommendation' })
async getRecommendation(
@Body() request: RecommendationRequest,
@CurrentUser() user: User
): Promise<RecommendationResponse> {
const startTime = Date.now();
try {
// Validate request
this.validateRequest(request);
// Get patient data
const patientData = await this.dataService.getPatientData(
request.patient.id,
request.dataScope
);
// Generate recommendations
const result = await this.recommendationEngine.generateRecommendations(
patientData,
request.query,
request.context
);
// Build response
const response = this.buildResponse(result, request);
// Audit log
await this.auditService.logRecommendationRequest(
request,
response,
user,
Date.now() - startTime
);
return response;
} catch (error) {
await this.auditService.logError(request, error, user);
throw this.handleError(error);
}
}
@Patch('/recommendations/:id/status')
@ApiOperation({ summary: 'Update recommendation status' })
async updateStatus(
@Param('id') recommendationId: string,
@Body() update: StatusUpdate,
@CurrentUser() user: User
): Promise<StatusUpdateResponse> {
// Record the action taken
const result = await this.recommendationEngine.recordAction(
recommendationId,
update,
user
);
// This feedback can be used for learning
if (update.outcome) {
await this.feedbackService.recordOutcome(
recommendationId,
update.outcome
);
}
return result;
}
}
interface StatusUpdate {
action: 'ACCEPTED' | 'MODIFIED' | 'REJECTED' | 'DEFERRED';
reason?: string;
modifications?: string;
outcome?: {
outcomeType: string;
outcomeDate?: string;
notes?: string;
};
}
```
### 4.3 Alert API
```typescript
// Alert API Specification
interface AlertAPI {
// Process potential alert trigger
processAlert: {
method: 'POST';
path: '/alerts/evaluate';
};
// Get active alerts for patient
getAlerts: {
method: 'GET';
path: '/alerts/patient/{patientId}';
};
// Acknowledge alert
acknowledgeAlert: {
method: 'POST';
path: '/alerts/{alertId}/acknowledge';
};
// Override alert
overrideAlert: {
method: 'POST';
path: '/alerts/{alertId}/override';
};
// Get alert statistics
getAlertStats: {
method: 'GET';
path: '/alerts/statistics';
};
}
// Alert Evaluation Request
interface AlertEvaluationRequest {
trigger: {
type: AlertTriggerType;
source: string;
data: any;
};
patient: {
id: string;
};
context: {
encounterId?: string;
userId: string;
userRole: string;
};
}
type AlertTriggerType =
| 'MEDICATION_ORDER'
| 'LAB_RESULT'
| 'VITAL_SIGN'
| 'DIAGNOSIS_ENTRY'
| 'ORDER_ENTRY'
| 'DOCUMENTATION'
| 'SCHEDULED_CHECK';
// Alert Response
interface AlertEvaluationResponse {
alerts: Alert[];
evaluationId: string;
timestamp: string;
processingTime: number;
}
interface Alert {
alertId: string;
category: string;
severity: 'INFO' | 'WARNING' | 'HIGH' | 'CRITICAL';
title: string;
message: string;
detail?: string;
// Source
source: {
system: string;
rule: string;
version: string;
};
// Patient
patient: {
id: string;
mrn?: string;
};
// Triggered by
trigger: {
type: string;
resource?: Resource;
};
// Actions
recommendedAction?: string;
suggestions?: AlertSuggestion[];
// Override options
overrideAllowed: boolean;
overrideReasons?: OverrideReason[];
// Links
links?: {
moreInfo?: string;
guideline?: string;
similar?: string;
};
// Timing
createdAt: string;
expiresAt?: string;
// Status
status: 'ACTIVE' | 'ACKNOWLEDGED' | 'OVERRIDDEN' | 'EXPIRED' | 'AUTO_RESOLVED';
}
// Alert Service Implementation
class AlertAPIService {
private alertEngine: AlertEngine;
private alertRepository: AlertRepository;
@Post('/alerts/evaluate')
async evaluateAlerts(
@Body() request: AlertEvaluationRequest
): Promise<AlertEvaluationResponse> {
const startTime = Date.now();
// Get patient context
const patientContext = await this.getPatientContext(request.patient.id);
// Evaluate alert rules
const alerts = await this.alertEngine.evaluate(
request.trigger,
patientContext,
request.context
);
// Apply suppression rules
const filteredAlerts = await this.applySuppressionRules(
alerts,
request.patient.id,
request.context.userId
);
// Store alerts
await this.alertRepository.storeAlerts(filteredAlerts);
return {
alerts: filteredAlerts,
evaluationId: generateUUID(),
timestamp: new Date().toISOString(),
processingTime: Date.now() - startTime
};
}
@Post('/alerts/:alertId/override')
async overrideAlert(
@Param('alertId') alertId: string,
@Body() override: AlertOverride,
@CurrentUser() user: User
): Promise<OverrideResponse> {
// Validate override is allowed
const alert = await this.alertRepository.getAlert(alertId);
if (!alert.overrideAllowed) {
throw new ForbiddenException('This alert cannot be overridden');
}
// Validate reason
if (alert.overrideReasons) {
const validReason = alert.overrideReasons.find(
r => r.code === override.reasonCode
);
if (!validReason) {
throw new BadRequestException('Invalid override reason');
}
}
// Record override
const result = await this.alertRepository.recordOverride(
alertId,
override,
user
);
// Audit log (important for safety)
await this.auditService.logAlertOverride(
alert,
override,
user
);
return result;
}
@Get('/alerts/statistics')
async getAlertStatistics(
@Query() params: AlertStatsParams
): Promise<AlertStatistics> {
return {
period: params.period,
totalAlerts: await this.getAlertCount(params),
bySeverity: await this.getAlertsBySeverity(params),
byCategory: await this.getAlertsByCategory(params),
overrideRate: await this.calculateOverrideRate(params),
acknowledgeTime: await this.calculateAcknowledgeTime(params),
topAlertTypes: await this.getTopAlertTypes(params),
alertFatigueTrend: await this.calculateAlertFatigueTrend(params)
};
}
}
interface AlertStatistics {
period: DateRange;
totalAlerts: number;
bySeverity: {
critical: number;
high: number;
warning: number;
info: number;
};
byCategory: { [category: string]: number };
overrideRate: {
overall: number;
bySeverity: { [severity: string]: number };
byCategory: { [category: string]: number };
};
acknowledgeTime: {
median: number;
p90: number;
bySeverity: { [severity: string]: number };
};
topAlertTypes: { type: string; count: number; overrideRate: number }[];
alertFatigueTrend: { date: string; alertsPerUser: number }[];
}
```
### 4.4 Knowledge Management API
```typescript
// Knowledge Management API
interface KnowledgeAPI {
// Guidelines
listGuidelines: {
method: 'GET';
path: '/knowledge/guidelines';
};
getGuideline: {
method: 'GET';
path: '/knowledge/guidelines/{guidelineId}';
};
evaluateGuideline: {
method: 'POST';
path: '/knowledge/guidelines/{guidelineId}/evaluate';
};
// Alert Rules
listAlertRules: {
method: 'GET';
path: '/knowledge/alert-rules';
};
getAlertRule: {
method: 'GET';
path: '/knowledge/alert-rules/{ruleId}';
};
createAlertRule: {
method: 'POST';
path: '/knowledge/alert-rules';
};
updateAlertRule: {
method: 'PUT';
path: '/knowledge/alert-rules/{ruleId}';
};
// Order Sets
listOrderSets: {
method: 'GET';
path: '/knowledge/order-sets';
};
getOrderSet: {
method: 'GET';
path: '/knowledge/order-sets/{orderSetId}';
};
// Calculators
listCalculators: {
method: 'GET';
path: '/knowledge/calculators';
};
executeCalculator: {
method: 'POST';
path: '/knowledge/calculators/{calculatorId}/execute';
};
}
// Guideline Evaluation
interface GuidelineEvaluationRequest {
patientId: string;
guidelineId: string;
evaluationContext?: {
encounterId?: string;
assessmentDate?: string;
};
returnActions: boolean;
}
interface GuidelineEvaluationResponse {
guidelineId: string;
guidelineTitle: string;
evaluationTimestamp: string;
patientId: string;
// Applicability
applicable: boolean;
applicabilityReason?: string;
// Compliance assessment
compliance: {
overall: 'COMPLIANT' | 'PARTIALLY_COMPLIANT' | 'NON_COMPLIANT' | 'NOT_APPLICABLE';
score: number; // 0-100
gaps: ComplianceGap[];
};
// Recommended actions
recommendedActions?: GuidelineAction[];
// Evidence
evidence: {
dataUsed: string[];
assumptions: string[];
};
}
interface ComplianceGap {
recommendation: string;
status: 'MET' | 'NOT_MET' | 'PARTIALLY_MET' | 'NOT_ASSESSED';
reason?: string;
suggestedAction?: string;
priority: 'HIGH' | 'MEDIUM' | 'LOW';
}
// Calculator Execution
interface CalculatorExecutionRequest {
calculatorId: string;
inputs: { [inputId: string]: any };
patientId?: string; // For auto-population
}
interface CalculatorExecutionResponse {
calculatorId: string;
calculatorName: string;
executionTimestamp: string;
// Inputs used
inputs: {
id: string;
name: string;
value: any;
source: 'PROVIDED' | 'AUTO_POPULATED' | 'DEFAULT';
}[];
// Result
result: {
value: number | string;
unit?: string;
formattedValue: string;
};
// Interpretation
interpretation?: {
category: string;
description: string;
recommendation?: string;
riskLevel?: 'LOW' | 'MODERATE' | 'HIGH' | 'VERY_HIGH';
};
// Confidence
confidence?: {
level: 'HIGH' | 'MEDIUM' | 'LOW';
limitations: string[];
};
// References
references?: Reference[];
}
// Knowledge Service Implementation
class KnowledgeAPIService {
private guidelineRepository: GuidelineRepository;
private guidelineEngine: GuidelineEngine;
private calculatorService: CalculatorService;
@Get('/knowledge/guidelines')
async listGuidelines(
@Query() params: GuidelineSearchParams
): Promise<GuidelineListResponse> {
const guidelines = await this.guidelineRepository.search({
category: params.category,
specialty: params.specialty,
status: params.status ?? 'active',
search: params.search,
pagination: {
page: params.page ?? 1,
pageSize: params.pageSize ?? 20
}
});
return {
guidelines: guidelines.items.map(g => ({
id: g.id,
title: g.title,
version: g.version,
category: g.category,
publisher: g.publisher,
lastUpdated: g.lastUpdated,
status: g.status
})),
pagination: {
page: guidelines.page,
pageSize: guidelines.pageSize,
total: guidelines.total,
totalPages: Math.ceil(guidelines.total / guidelines.pageSize)
}
};
}
@Post('/knowledge/guidelines/:id/evaluate')
async evaluateGuideline(
@Param('id') guidelineId: string,
@Body() request: GuidelineEvaluationRequest
): Promise<GuidelineEvaluationResponse> {
// Get guideline
const guideline = await this.guidelineRepository.getById(guidelineId);
if (!guideline) {
throw new NotFoundException('Guideline not found');
}
// Get patient data
const patientData = await this.patientDataService.getPatientData(
request.patientId
);
// Evaluate
const evaluation = await this.guidelineEngine.evaluate(
guideline,
patientData,
request.evaluationContext
);
return evaluation;
}
@Post('/knowledge/calculators/:id/execute')
async executeCalculator(
@Param('id') calculatorId: string,
@Body() request: CalculatorExecutionRequest
): Promise<CalculatorExecutionResponse> {
// Get calculator definition
const calculator = await this.calculatorRepository.getById(calculatorId);
if (!calculator) {
throw new NotFoundException('Calculator not found');
}
// Auto-populate inputs if patient provided
let inputs = { ...request.inputs };
if (request.patientId) {
inputs = await this.autoPopulateInputs(
calculator,
request.patientId,
inputs
);
}
// Validate inputs
this.validateCalculatorInputs(calculator, inputs);
// Execute
const result = await this.calculatorService.execute(calculator, inputs);
return result;
}
}
```
### 4.5 Streaming API for Real-Time CDSS
```typescript
// Real-Time Streaming API
interface CDSSStreamingAPI {
protocols: {
websocket: 'wss://api.cdss.wia.org/v1/stream';
sse: 'https://api.cdss.wia.org/v1/events';
mqtt: 'mqtts://mqtt.cdss.wia.org';
};
channels: {
patientAlerts: PatientAlertChannel;
vitalSignMonitoring: VitalSignChannel;
earlyWarning: EarlyWarningChannel;
orderRecommendations: OrderRecommendationChannel;
};
}
// WebSocket Implementation
class CDSSWebSocketService {
private connections: Map<string, WebSocket> = new Map();
private subscriptions: Map<string, Set<string>> = new Map();
@WebSocketGateway('/stream')
handleConnection(client: WebSocket, request: IncomingMessage) {
const userId = this.authenticateConnection(request);
this.connections.set(userId, client);
client.on('message', (message) => this.handleMessage(userId, message));
client.on('close', () => this.handleDisconnect(userId));
}
private handleMessage(userId: string, message: WebSocket.Data) {
const parsed = JSON.parse(message.toString());
switch (parsed.type) {
case 'SUBSCRIBE':
this.handleSubscribe(userId, parsed);
break;
case 'UNSUBSCRIBE':
this.handleUnsubscribe(userId, parsed);
break;
case 'ACKNOWLEDGE':
this.handleAcknowledge(userId, parsed);
break;
}
}
private handleSubscribe(userId: string, subscription: SubscriptionRequest) {
const channelKey = this.buildChannelKey(subscription);
if (!this.subscriptions.has(channelKey)) {
this.subscriptions.set(channelKey, new Set());
}
this.subscriptions.get(channelKey)!.add(userId);
// Start monitoring if patient subscription
if (subscription.channel === 'PATIENT_ALERTS') {
this.startPatientMonitoring(subscription.patientId);
}
this.sendToUser(userId, {
type: 'SUBSCRIBED',
channel: subscription.channel,
subscriptionId: generateUUID()
});
}
// Broadcast alert to subscribed users
async broadcastAlert(alert: Alert) {
const channelKey = `PATIENT_ALERTS:${alert.patient.id}`;
const subscribers = this.subscriptions.get(channelKey);
if (subscribers) {
const message: AlertMessage = {
type: 'ALERT',
alert,
timestamp: new Date().toISOString()
};
for (const userId of subscribers) {
await this.sendToUser(userId, message);
}
}
}
private async sendToUser(userId: string, message: any) {
const connection = this.connections.get(userId);
if (connection && connection.readyState === WebSocket.OPEN) {
connection.send(JSON.stringify(message));
}
}
}
// Early Warning System Streaming
interface EarlyWarningChannel {
description: 'Real-time early warning scores and alerts';
subscriptionRequest: {
channel: 'EARLY_WARNING';
patientId: string;
thresholds?: {
newsScore?: number;
customScores?: { [scoreName: string]: number };
};
};
events: {
SCORE_UPDATE: {
patientId: string;
scoreType: string;
score: number;
previousScore?: number;
trend: 'IMPROVING' | 'STABLE' | 'WORSENING';
timestamp: string;
components: ScoreComponent[];
};
THRESHOLD_BREACH: {
patientId: string;
scoreType: string;
score: number;
threshold: number;
severity: 'WARNING' | 'CRITICAL';
timestamp: string;
recommendedActions: string[];
};
RAPID_DETERIORATION: {
patientId: string;
indicators: string[];
confidence: number;
timeToEvent?: string;
timestamp: string;
};
};
}
// Early Warning Score Service
class EarlyWarningService {
private scoreCalculators: Map<string, ScoreCalculator> = new Map();
private monitoredPatients: Map<string, PatientMonitor> = new Map();
async startMonitoring(patientId: string, config: MonitoringConfig) {
// Create patient monitor
const monitor = new PatientMonitor(patientId, config);
// Subscribe to vital sign stream
monitor.subscribeToVitals(async (vitals) => {
// Calculate scores
const scores = await this.calculateScores(patientId, vitals);
// Check for threshold breaches
for (const score of scores) {
if (score.value >= config.thresholds[score.type]) {
await this.handleThresholdBreach(patientId, score, config);
}
}
// Emit score updates
await this.emitScoreUpdate(patientId, scores);
});
this.monitoredPatients.set(patientId, monitor);
}
private async calculateScores(
patientId: string,
vitals: VitalSigns
): Promise<CalculatedScore[]> {
const scores: CalculatedScore[] = [];
// NEWS2 (National Early Warning Score 2)
const news2 = await this.calculateNEWS2(vitals);
scores.push({
type: 'NEWS2',
value: news2.total,
components: news2.components,
interpretation: this.interpretNEWS2(news2.total)
});
// MEWS (Modified Early Warning Score)
const mews = await this.calculateMEWS(vitals);
scores.push({
type: 'MEWS',
value: mews.total,
components: mews.components
});
return scores;
}
private calculateNEWS2(vitals: VitalSigns): NEWS2Score {
const components: ScoreComponent[] = [];
// Respiratory rate
const rrScore = this.scoreRespiratoryRate(vitals.respiratoryRate?.value);
components.push({ name: 'Respiratory Rate', value: vitals.respiratoryRate?.value, score: rrScore });
// SpO2 (two scales based on O2 supplementation)
const spo2Score = this.scoreSpO2(
vitals.oxygenSaturation?.value,
vitals.oxygenSaturation?.supplementalOxygen
);
components.push({ name: 'SpO2', value: vitals.oxygenSaturation?.value, score: spo2Score });
// Air or oxygen
const airScore = vitals.oxygenSaturation?.supplementalOxygen ? 2 : 0;
components.push({ name: 'Air or Oxygen', value: vitals.oxygenSaturation?.supplementalOxygen ? 'Oxygen' : 'Air', score: airScore });
// Systolic BP
const sbpScore = this.scoreSystolicBP(vitals.bloodPressure?.systolic);
components.push({ name: 'Systolic BP', value: vitals.bloodPressure?.systolic, score: sbpScore });
// Heart rate
const hrScore = this.scoreHeartRate(vitals.heartRate?.value);
components.push({ name: 'Heart Rate', value: vitals.heartRate?.value, score: hrScore });
// Consciousness (AVPU or GCS)
const consciousnessScore = this.scoreConsciousness(vitals.consciousness);
components.push({ name: 'Consciousness', value: vitals.consciousness, score: consciousnessScore });
// Temperature
const tempScore = this.scoreTemperature(vitals.temperature?.value);
components.push({ name: 'Temperature', value: vitals.temperature?.value, score: tempScore });
const total = components.reduce((sum, c) => sum + c.score, 0);
return { total, components };
}
private interpretNEWS2(score: number): NEWS2Interpretation {
if (score >= 7) {
return {
level: 'HIGH',
clinicalRisk: 'High',
response: 'Emergency response team review',
frequency: 'Continuous monitoring',
color: 'RED'
};
} else if (score >= 5) {
return {
level: 'MEDIUM',
clinicalRisk: 'Medium',
response: 'Urgent review by clinician',
frequency: 'Minimum 1-hourly',
color: 'ORANGE'
};
} else if (score >= 1) {
return {
level: 'LOW_MEDIUM',
clinicalRisk: 'Low-Medium',
response: 'Assessment by ward nurse',
frequency: 'Minimum 4-6 hourly',
color: 'YELLOW'
};
} else {
return {
level: 'LOW',
clinicalRisk: 'Low',
response: 'Continue routine monitoring',
frequency: 'Minimum 12-hourly',
color: 'GREEN'
};
}
}
}
```
### 4.6 GraphQL API for Complex Queries
```typescript
// GraphQL Schema for CDSS
const cdssGraphQLSchema = `
type Query {
# Patient queries
patient(id: ID!): Patient
patientRecommendations(patientId: ID!, types: [RecommendationType!]): [Recommendation!]!
# Alert queries
alerts(
patientId: ID
severity: [AlertSeverity!]
status: [AlertStatus!]
dateRange: DateRangeInput
): AlertConnection!
# Knowledge queries
guidelines(
category: String
specialty: String
search: String
): GuidelineConnection!
calculators(category: String): [Calculator!]!
# Analytics queries
alertStatistics(
dateRange: DateRangeInput!
groupBy: StatisticsGroupBy
): AlertStatistics!
complianceReport(
guidelineId: ID!
patientId: ID
departmentId: ID
): ComplianceReport!
}
type Mutation {
# Recommendation actions
acknowledgeRecommendation(
recommendationId: ID!
action: RecommendationAction!
reason: String
): RecommendationActionResult!
# Alert actions
acknowledgeAlert(alertId: ID!): Alert!
overrideAlert(alertId: ID!, reason: OverrideReasonInput!): Alert!
# Feedback
submitFeedback(input: FeedbackInput!): FeedbackResult!
}
type Subscription {
# Real-time alerts
patientAlerts(patientId: ID!): Alert!
departmentAlerts(departmentId: ID!): Alert!
# Early warning
earlyWarningScore(patientId: ID!): EarlyWarningEvent!
}
type Patient {
id: ID!
mrn: String
name: HumanName!
birthDate: Date!
age: Int!
gender: Gender!
# Clinical data
conditions: [Condition!]!
medications: [Medication!]!
allergies: [Allergy!]!
recentLabs(days: Int = 30): [LabResult!]!
vitals: VitalSigns
# CDSS data
activeAlerts: [Alert!]!
recommendations: [Recommendation!]!
riskScores: [RiskScore!]!
guidelineCompliance: [GuidelineCompliance!]!
}
type Recommendation {
id: ID!
type: RecommendationType!
title: String!
description: String!
strength: RecommendationStrength!
urgency: Urgency!
evidenceLevel: EvidenceLevel!
rationale: String!
actions: [RecommendedAction!]!
alternatives: [Alternative!]
references: [Reference!]
createdAt: DateTime!
expiresAt: DateTime
status: RecommendationStatus!
}
type Alert {
id: ID!
category: AlertCategory!
severity: AlertSeverity!
title: String!
message: String!
detail: String
patient: Patient!
trigger: AlertTrigger!
recommendedAction: String
overrideAllowed: Boolean!
overrideReasons: [OverrideReason!]
status: AlertStatus!
createdAt: DateTime!
acknowledgedAt: DateTime
acknowledgedBy: User
overriddenAt: DateTime
overriddenBy: User
overrideReason: String
}
enum RecommendationType {
DIAGNOSIS_DIFFERENTIAL
TREATMENT_RECOMMENDATION
DRUG_SELECTION
DOSING_RECOMMENDATION
SCREENING
RISK_ASSESSMENT
LAB_INTERPRETATION
GUIDELINE_COMPLIANCE
}
enum AlertSeverity {
INFO
WARNING
HIGH
CRITICAL
}
enum AlertStatus {
ACTIVE
ACKNOWLEDGED
OVERRIDDEN
EXPIRED
AUTO_RESOLVED
}
`;
// GraphQL Resolvers
class CDSSGraphQLResolvers {
@Query('patient')
async getPatient(@Args('id') id: string): Promise<Patient> {
return this.patientService.getPatient(id);
}
@Query('patientRecommendations')
async getPatientRecommendations(
@Args('patientId') patientId: string,
@Args('types') types?: RecommendationType[]
): Promise<Recommendation[]> {
return this.recommendationService.getPatientRecommendations(
patientId,
types
);
}
@Query('alerts')
async getAlerts(
@Args() args: AlertQueryArgs
): Promise<AlertConnection> {
return this.alertService.queryAlerts(args);
}
@Mutation('acknowledgeAlert')
async acknowledgeAlert(
@Args('alertId') alertId: string,
@CurrentUser() user: User
): Promise<Alert> {
return this.alertService.acknowledge(alertId, user);
}
@Subscription('patientAlerts')
subscribeToPatientAlerts(
@Args('patientId') patientId: string
): AsyncIterator<Alert> {
return this.pubSub.asyncIterator(`PATIENT_ALERTS:${patientId}`);
}
@ResolveField('Patient.recommendations')
async resolveRecommendations(
@Parent() patient: Patient
): Promise<Recommendation[]> {
return this.recommendationService.getActiveRecommendations(patient.id);
}
@ResolveField('Patient.riskScores')
async resolveRiskScores(
@Parent() patient: Patient
): Promise<RiskScore[]> {
return this.riskService.calculateRiskScores(patient.id);
}
}
```
---
**WIA-CLINICAL-DECISION-SUPPORT API Interface**
**Version**: 1.0.0
**Last Updated**: 2025
**License**: MIT
© 2025 World Interoperability Alliance (WIA)
弘益人間 (홍익인간) - Benefit All Humanity
Korea operates a comprehensive industrial cluster system. Korea Top 12 National Strategic Technologies (5th Science and Technology Master Plan 2023-2027): (1) Semiconductors and Displays (2) Secondary Batteries (3) Advanced Mobility (autonomous driving, UAM) (4) Next-Generation Nuclear (SMR) (5) Advanced Bio (6) Aerospace and Marine (7) Hydrogen (8) Cybersecurity (9) Artificial Intelligence (10) Next-Generation Communications (11) Advanced Robotics and Manufacturing (12) Quantum. 12 fields receive direct investment of 5 trillion KRW annually, cumulative 30 trillion KRW by 2030. Korea Major Industrial Clusters: Pangyo IT Cluster (1,300+ companies, 100 trillion KRW revenue), Gangnam Fintech (200+ companies), Songdo BT Bio Cluster, Daegu Medical Cluster, Ulsan Industry (shipbuilding, petrochemicals, automotive), Changwon Machinery, Changwon National Industrial Complex, Siheung and Banwol (SME manufacturing), Yeosu Petrochemicals, Pyeongtaek Semiconductor (Samsung Electronics Pyeongtaek Campus), Icheon and Cheongju Semiconductor (SK hynix Icheon and Cheongju Campuses), Asan Display (Samsung Display Asan Campus), Gumi Mobile (Samsung Gumi Campus), Pohang Steel (POSCO Pohang Steel Mill), Gwangyang Steel (POSCO Gwangyang Steel Mill), Dangjin Steel (Hyundai Steel Dangjin), Ulsan Automotive (Hyundai Motor Ulsan Plant), Asan Automotive (Hyundai Asan Plant), Kia Gwangju and Sohari, POSCO Gwangyang and Pohang Steel Mills, SK hynix Icheon and Cheongju, Samsung Electronics Hwaseong, Giheung, Pyeongtaek, Onyang, Cheonan, Asan Semiconductor Facilities. Major Industrial Complexes and Techno Valleys: Pangyo Techno Valley (1st 800 companies, 2nd 600 companies, 3rd 1,200 companies), Dongtan Techno Valley, Gwanggyo Techno Valley, Songdo IBD, Yeouido Financial District, Gangnam Teheran-ro Valley, Sihwa, Banwol, Gumi, Ulsan, Changwon, Geoje, Yeosu, Ulsan Mipo, Onsan, Cheongju, Iksan, Gwangyang, Yeosu, POSCO Gwangyang Steel Mill, Asan Bay, Seosan, Songdo, Incheon Airport, Sejong, Cheongna, Geomdan, Pyeongtaek Automotive Industrial Complex, Giheung Semiconductor Complex, Icheon Semiconductor Complex, Asan Display Complex, Gumi Mobile Complex, Changwon National Industrial Complex, Ulsan Mipo National Industrial Complex, Yeosu National Industrial Complex, Onsan National Industrial Complex. Korea Workforce Statistics: STEM undergraduate students 700,000 (26% of all university students), STEM graduate students 170,000, PhD researchers 140,000, STEM doctorates conferred 8,000 annually (Seoul National University 1,200, KAIST 800, POSTECH 400, Yonsei University 700, Korea University 600, UNIST 250, DGIST 100, GIST 200, KISTI 50, KIST and ETRI postdoctoral programs 1,000), information security experts 300,000 (KISA-trained and private), AI experts 50,000 (NIA, IITP, NIPA, Samsung, LG, SK, NAVER, Kakao trained), semiconductor experts 260,000 (Samsung Electronics 60,000, SK hynix 30,000, DB HiTek, SK siltron). National R&D Project Operation: National R&D projects 100,000+ annually (MSIT 35,000, MOTIE 25,000, MSS 20,000, MOE 15,000, others 5,000), R&D participating institutions 25,000+, R&D participating researchers 530,000, National R&D output (papers, patents) 540,000 annually. Korea Corporate R&D Investment Top 10 (2024): Samsung Electronics 28 trillion KRW, LG Electronics 9 trillion KRW, SK hynix 8 trillion KRW, Hyundai Motor 6 trillion KRW, Kia 4 trillion KRW, LG Chem 3.5 trillion KRW, LG Display 3.2 trillion KRW, POSCO 3 trillion KRW, Samsung SDI 2.7 trillion KRW, SK Innovation 2.5 trillion KRW.
Korea leads global standardization cooperation in 4th industrial revolution technologies. Korea Quantum Technology Standards: "Quantum Science and Technology Comprehensive Development Plan 2024-2030" (8 trillion KRW R&D), National Quantum Science and Technology Committee, MSIT Quantum Technology Bureau, KIST Quantum Information Research Division, KAIST Quantum Graduate School, POSTECH Quantum Science and Technology Division, KAIST IQC, Seoul National University Quantum Information Center, Korea Institute for Advanced Study Quantum Computing Division, KRISS Quantum Measurement Standards Center, SK Telecom QKD, KT QKD, LG U+ QKD, Samsung SDS PQC, Easy Security, CryptoLab Quantum-Resistant Cryptography, KS X ISO/IEC 18033-3, NIST PQC ML-KEM/ML-DSA/SLH-DSA Korean adoption, QKD ETSI GS QKD series Korean Profile. Korea Next-Generation Communications (5G/6G) Standards: 5G subscribers 35 million, 5G base stations 350,000, 5G dedicated networks 16 operators, 6G Acceleration Council (MSIT 2024), 6G commercialization target 2028, 3GPP Release 18/19/20 Korean participation, KS X 3GPP, Samsung Research 6G, LG Electronics 6G, KT 6G, SK Telecom 6G, LG U+ 6G, NIA, ETRI, KAIST, POSTECH, Seoul National University 6G Research Division, O-RAN ALLIANCE Korean Chair Company, M-CORD, OpenRAN Korean Cooperation. Korea AI Standards: KS X ISO/IEC 22989 (AI Concepts and Terminology), KS X ISO/IEC 23053 (AI System Framework), KS X ISO/IEC 5338 (AI System Lifecycle), KS X ISO/IEC 24029 (AI Trustworthiness and Robustness), KS X ISO/IEC 24028 (AI Trustworthiness), KS X ISO/IEC 23894 (AI Risk Management), KS X ISO/IEC 38507 (AI Governance), KS X ISO/IEC 42001 (AIMS Operations System), KS X ISO/IEC 42005 (AI Impact Assessment), AI Framework Act (effective July 2026) Enforcement Decree, Mandatory ex-ante impact assessment for high-impact AI, Samsung Research HyperCLOVA X, LG AI Research EXAONE, SK Telecom A., KT Media AI, NAVER Clova, Kakao i Korean foundation models. Korea Bio Standards: KS X ISO 20387 (Biobanking), KS X ISO 21709, KS X HL7 FHIR R5, SNOMED CT, LOINC, KCD-8, ICD-11, OMOP CDM v5.4, CDISC SDTM, DICOM, HL7 V2, HL7 CDA, MFDS GMP, MFDS Good Tissue Practice, MFDS AI Medical Device Guidelines (50+ approvals), KRIBB, KRICT, KFRI, KIST, KAIST, POSTECH Bio R&D Centers, Samsung Biologics, Celltrion, SK Bioscience, GC Biopharma, LG Chem, Chong Kun Dang, Yuhan Korean Bio Pharmaceuticals, 6 Major Hospitals (Seoul National University, Samsung, Asan, Severance, Bundang Seoul National University, Korea University) Clinical Trial Infrastructure. Korea Aerospace Standards: Korea AeroSpace Administration (KASA, established May 27 2024), MSIT, Ministry of National Defense, KARI, KASI, KIGAM, ETRI, KAI, Hanwha Aerospace, Hanwha Systems, LIG Nex1, CCSDS, ITU, NORAD, IADC, NASA, ESA, JAXA, CNSA, ISRO Korean Cooperation, KS W ISO 14620, KS W ISO 11227, KS W ISO 27026, Nuri Rocket KSLV-II, KSLV-III, Danuri KPLO, Next-Generation Reconnaissance Satellite 425 Project, Arirang, Cheollian, KOMPSAT, CAS500 series. Korea Secondary Battery Standards: "3rd Secondary Battery Industry Development Strategy 2024-2030", MOTIE Secondary Battery Bureau, LG Energy Solution, Samsung SDI, SK On, POSCO Future M, EcoPro BM, L&F, DI Dongil, Samsung SDI Korean Secondary Battery 6 Companies, KS C IEC 62660, KS C IEC 62619, KS C IEC 62133, UN ECE R100, UN/ECE R136 Korean Adoption. Korea Semiconductor Standards: Samsung Electronics (HBM3E, HBM4, DDR5, LPDDR5X), SK hynix (HBM3E 12-Hi, HBM4), DB HiTek, SK siltron, SK Enpulse, Dongjin Semichem, Seoul Semiconductor, Simmtech, Samsung Display, LG Display, JEDEC, SEMI, IEEE, KS C IEC 60068, UCIe 1.1/2.0, CXL 3.0/3.1, HBM4 Standardization, DDR6 Standardization, LPDDR6 Standardization, MRAM, ReRAM, PCRAM Korean Standards Adoption.
Korea operates city, regional, education, and cultural infrastructure with the following statistics. Korea 17 Metropolitan Governments: Seoul Metropolitan City (population 9.45 million), Busan Metropolitan City (3.27 million), Daegu Metropolitan City (2.36 million), Incheon Metropolitan City (3.00 million), Gwangju Metropolitan City (1.43 million), Daejeon Metropolitan City (1.43 million), Ulsan Metropolitan City (1.09 million), Sejong Special Self-Governing City (0.39 million), Gyeonggi Province (13.94 million), Gangwon Special Self-Governing Province (1.52 million), Chungcheongbuk Province (1.59 million), Chungcheongnam Province (2.12 million), Jeollabuk Special Self-Governing Province (1.75 million), Jeollanam Province (1.81 million), Gyeongsangbuk Province (2.56 million), Gyeongsangnam Province (3.27 million), Jeju Special Self-Governing Province (0.67 million). 17 metropolitan governments and 226 city/county/district administrations. Korea Digital Education Infrastructure: Elementary, middle, high school students 5.4 million, universities 187 (4-year 192, 2-year colleges 134, graduate schools 1,200), university enrollment 2.8 million, doctoral students 170,000, lifelong learners 22 million, digital textbook coverage 78% (2024), EBS, KOOC (Korea Massive Open Online Course), KOCW (Korea OpenCourseWare), K-MOOC operation. K-Content Industry Statistics (2024): K-Content total revenue 158 trillion KRW, K-Content exports 14 trillion KRW (BTS, BLACKPINK, NewJeans K-POP), K-Drama (Squid Game, Crash Landing on You), K-Game (PUBG, Lineage W, MapleStory), K-Webtoon (NAVER Webtoon, Kakao Webtoon), K-Publishing, K-Broadcasting. Korea Creative Content Agency (KOCCA), Ministry of Culture Sports and Tourism (MCST), Korea Communications Agency (KCA), Korea Culture Information Service Agency, Korean Film Archive, Korea Publishing Industry Promotion Agency, National Gugak Center, National Institute of Korean Language, National Museum of Korea, National Library of Korea operations. Korea Medical Cost Statistics: National Health Insurance total expenditure 110 trillion KRW (2024), medical institution treatment costs 95 trillion KRW, pharmaceutical costs 24 trillion KRW, per capita medical expense 2.2 million KRW per year, elderly (65+) medical expense ratio 45%, Long-term Care Insurance subscribers 52 million, medical institutions 96,000+, general hospitals 350, dental/oriental medicine/pharmacy/health centers 80,000+, NHIS coverage 99.7%, MyData medical data integration 4 designated combination specialists. Korea Social Welfare Statistics (2024): Social welfare total budget 244 trillion KRW, National Pension subscribers 22 million, National Pension recipients 7 million, Basic Pension recipients 7 million, Long-term Care recipients 1.1 million, Child Allowance recipients 2.8 million, Basic Livelihood Security recipients 2.3 million, Earned Income Tax Credit recipient households 4.8 million, Education Benefit recipients 4.7 million. Korea Environment Statistics (2024): 22 national parks, 15 provincial parks, 45 Ramsar wetlands, 12,587 species registered Korean Peninsula wildlife, Korean Peninsula forest area 6.33 million ha (63% of land), CO2 emissions 650 million tons (2030 reduction target 440 million tons, -32.5%), renewable energy share 9% (2024, 2030 target 21.6%), accumulated EVs 600,000, accumulated hydrogen vehicles 35,000. Korea Safety / Security Statistics: Police officers 127,000, firefighters 65,000, 119 calls 6.7 million per year, 112 calls 18 million per year, Coast Guard 10,000, National Cyber Security Center (NCSC) operation, KISA cyber incident reports 280,000 per year, FSEC financial cyber incident reports 40,000 per year, National Disaster Management System (CDSS), National Crisis Management Center operation.
Korea operates international standardization activities and multilateral cooperation. ISO TC/SC Korean Secretariat Activities: ISO/TC 22 (Road vehicles) Korean Secretariat, ISO/TC 184 (Automation systems) Korean Secretariat, ISO/TC 215 (Health informatics) Korean Secretariat, ISO/TC 229 (Nanotechnologies) Korean Secretariat, ISO/TC 268 (Sustainable cities) Korean Secretariat, ISO/TC 307 (Blockchain) Korean Secretariat, ISO/IEC JTC 1 (Information technology) Korean Secretariat 50+ fields, ISO/IEC JTC 1/SC 27 (Information security) Korean Chair, ISO/IEC JTC 1/SC 38 (Cloud computing) Korean Chair, ISO/IEC JTC 1/SC 42 (AI) Korean Vice-Chair. IEC TC Korean Secretariat: IEC TC 9 (Electric railway) Korean Secretariat, IEC TC 14 (Power transformers) Korean Secretariat, IEC TC 22 (Power electronics) Korean Secretariat, IEC TC 47 (Semiconductors) Korean Secretariat, IEC TC 86 (Fibre optics) Korean Secretariat, IEC TC 100 (Audio-video) Korean Secretariat, IEC TC 110 (Electronic display) Korean Secretariat, IEC TC 119 (Printed electronics) Korean Secretariat, IEC SC 65A/B/C/D (Industrial-process measurement) Korean Chair. ITU-T Study Group Korean Chair Activities: SG 9 (Cable networks), SG 13 (Future networks), SG 15 (Networks technologies), SG 16 (Multimedia), SG 17 (Security), SG 20 (IoT and smart city), SG 21 (Multimedia and metaverse) Korean Chair or Vice-Chair activities. 3GPP RAN/SA Korean Chairs: 3GPP RAN1 (Radio Layer 1), RAN2 (Radio Layer 2 and 3 RR), RAN3 (Iub, Iuc, Iur interfaces), RAN4 (Radio performance and protocol aspects), SA1 (Services), SA2 (Architecture), SA3 (Security), SA4 (Codec), SA5 (Telecom management), SA6 (Mission-critical applications) Korean Chair or Vice-Chair. Korea contributed 7,800+ 5G standard proposals (through 3GPP Release 18), 1,200+ 6G standard proposals. IEEE 802 Korean Chairs: 802.3 (Ethernet) Working Group, 802.11 (WiFi) Working Group, 802.15 (WPAN) Working Group, 802.1 (Bridging) Working Group, 802.16 (WiMAX) Working Group, 802.18 (Radio Regulatory) Korean Chair or Vice-Chair. OECD CSTP, UN ESCAP, APEC SCSC Korean Cooperation: OECD Committee for Scientific and Technological Policy Korean member, UN Economic and Social Commission for Asia and the Pacific Korean member, APEC Sub-Committee on Standards and Conformance Korean member, APEC Engineers Coordinating Committee Korean member, ANSI (American National Standards Institute) Korean cooperation, BSI (British Standards Institution) Korean cooperation, DIN (Deutsches Institut fur Normung) Korean cooperation, AFNOR (Association Francaise de Normalisation) Korean cooperation, JISC (Japanese Industrial Standards Committee) Korean cooperation, SAC (Standardization Administration of China) Korean cooperation. W3C, OASIS, IETF Korean Cooperation: W3C Korea Office operation (10+ working groups), OASIS Korea Office operation (LegalDocML, LegalRuleML, SAML, UBL, BPM working groups), IETF Korea Cooperation (KS X IETF series Korean adoption), ICANN Korean cooperation, KRNIC (Korea Network Information Center) operation, KISA Korea Internet Center, BGP Korea, NCSC (National Cyber Security Center). WIPO, UNCTAD, WTO, G20 Korean Cooperation: WIPO (World Intellectual Property Organization) Korean member, UNCTAD (UN Conference on Trade and Development) Korean member, WTO (World Trade Organization) Korean member, G20 Korean member (joined 1999), G7 cooperation, OECD member (1996), UN member (1991), KEDO (Korean Peninsula Energy Development Organization), Six-Party Talks (South/North Korea, US, China, Russia, Japan), Korea-US, Korea-Japan, Korea-China bilateral standards cooperation agreements.