Spaces:
Sleeping
Sleeping
| // ββ ai.controller.ts ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| import { Controller, Post, Body, UseGuards } from '@nestjs/common'; | |
| import { AuthGuard } from '@nestjs/passport'; | |
| import { ApiTags, ApiBearerAuth, ApiOperation } from '@nestjs/swagger'; | |
| import { AiService } from './ai.service.backend'; | |
| ('AI') | |
| () | |
| (AuthGuard('jwt')) | |
| ('ai') | |
| export class AiController { | |
| constructor(private aiService: AiService) {} | |
| ('suggest-codes') | |
| ({ summary: 'AI suggest ICD-10 and CPT codes from clinical notes' }) | |
| suggestCodes(() body: { clinicalNotes: string; existingDiagnosticCodes?: any[]; existingProcedureCodes?: any[] }) { | |
| return this.aiService.suggestCodes( | |
| body.clinicalNotes, | |
| body.existingDiagnosticCodes || [], | |
| body.existingProcedureCodes || [], | |
| ); | |
| } | |
| ('chat') | |
| ({ summary: 'AI chat assistant for medical coding' }) | |
| chat(() body: { messages: any[]; encounterContext?: any }) { | |
| return this.aiService.chat(body.messages, body.encounterContext); | |
| } | |
| ('validate-codes') | |
| ({ summary: 'Validate ICD-10 and CPT code combinations' }) | |
| validateCodes(() body: { diagnosticCodes: any[]; procedureCodes: any[] }) { | |
| return this.aiService.validateCodes(body.diagnosticCodes, body.procedureCodes); | |
| } | |
| } | |