feature: a minimal v1 backend implemented for treatments feature.
This commit is contained in:
@@ -16,7 +16,6 @@ import { CreatePatientDto } from './dto/create-patient.dto';
|
||||
import { ListPatientsDto } from './dto/list-patients.dto';
|
||||
import { UpdatePatientDto } from './dto/update-patient.dto';
|
||||
import { PatientsService } from './patients.service';
|
||||
import { CreateTreatmentHistoryDto } from './dto/create-treatment-history.dto';
|
||||
|
||||
@ApiTags('patients')
|
||||
@ApiBearerAuth('JWT-auth')
|
||||
@@ -52,26 +51,4 @@ export class PatientsController {
|
||||
const organizationId = this.patientsService.getOrganizationIdFromUser(req.user);
|
||||
return this.patientsService.update(id, updatePatientDto, organizationId);
|
||||
}
|
||||
|
||||
@Get(':id/treatments')
|
||||
@ApiOperation({ summary: 'Get patient treatment history' })
|
||||
findTreatments(
|
||||
@Param('id') id: string,
|
||||
@Query('limit', new ParseIntPipe({ optional: true })) limit = 20,
|
||||
@Req() req,
|
||||
) {
|
||||
const organizationId = this.patientsService.getOrganizationIdFromUser(req.user);
|
||||
return this.patientsService.findTreatments(id, organizationId, limit);
|
||||
}
|
||||
|
||||
@Post(':id/treatments')
|
||||
@ApiOperation({ summary: 'Add treatment history item for a patient' })
|
||||
addTreatment(
|
||||
@Param('id') id: string,
|
||||
@Body() dto: CreateTreatmentHistoryDto,
|
||||
@Req() req,
|
||||
) {
|
||||
const organizationId = this.patientsService.getOrganizationIdFromUser(req.user);
|
||||
return this.patientsService.addTreatment(id, dto, organizationId);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user