Spaces:
Sleeping
Sleeping
| import { Controller, Get, Post, Body, Param, Query, UseGuards } from '@nestjs/common'; | |
| import { AuthGuard } from '@nestjs/passport'; | |
| import { ApiTags, ApiBearerAuth, ApiOperation, ApiQuery } from '@nestjs/swagger'; | |
| import { CodesService, GlobalSearchResult } from './codes.service'; | |
| import { CreateDiagnosticCodeDto } from './dto/create-diagnostic-code.dto'; | |
| import { CreateProcedureCodeDto } from './dto/create-procedure-code.dto'; | |
| import { SearchCodesDto } from './dto/search-codes.dto'; | |
| ('Codes') | |
| () | |
| (AuthGuard('jwt')) | |
| ('codes') | |
| export class CodesController { | |
| constructor(private codesService: CodesService) {} | |
| // βββ Global βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| ('search') | |
| ({ summary: 'Search across ICD-10 and CPT codes' }) | |
| ({ name: 'q', required: true }) | |
| ({ name: 'limit', required: false }) | |
| globalSearch( | |
| ('q') q: string, | |
| ('limit') limit?: number, | |
| ): Promise<GlobalSearchResult> { | |
| return this.codesService.globalSearch(q, limit); | |
| } | |
| // βββ ICD-10 βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| ('icd10') | |
| ({ summary: 'Search ICD-10 diagnostic codes' }) | |
| searchICD10(() dto: SearchCodesDto) { | |
| return this.codesService.searchICD10(dto); | |
| } | |
| ('icd10/categories') | |
| ({ summary: 'Get ICD-10 categories' }) | |
| icd10Categories() { | |
| return this.codesService.getICD10Categories(); | |
| } | |
| ('icd10/:code') | |
| ({ summary: 'Get ICD-10 code by code string' }) | |
| getICD10(('code') code: string) { | |
| return this.codesService.getICD10ByCode(code); | |
| } | |
| ('icd10') | |
| ({ summary: 'Create ICD-10 code' }) | |
| createICD10(() dto: CreateDiagnosticCodeDto) { | |
| return this.codesService.createICD10(dto); | |
| } | |
| // βββ CPT ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| ('cpt') | |
| ({ summary: 'Search CPT procedure codes' }) | |
| searchCPT(() dto: SearchCodesDto) { | |
| return this.codesService.searchCPT(dto); | |
| } | |
| ('cpt/categories') | |
| ({ summary: 'Get CPT categories' }) | |
| cptCategories() { | |
| return this.codesService.getCPTCategories(); | |
| } | |
| ('cpt/:code') | |
| ({ summary: 'Get CPT code by code string' }) | |
| getCPT(('code') code: string) { | |
| return this.codesService.getCPTByCode(code); | |
| } | |
| ('cpt') | |
| ({ summary: 'Create CPT code' }) | |
| createCPT(() dto: CreateProcedureCodeDto) { | |
| return this.codesService.createCPT(dto); | |
| } | |
| } |