Documentation Index
Fetch the complete documentation index at: https://docs.nextmed.med.br/llms.txt
Use this file to discover all available pages before exploring further.
Encaminhamentos
Criar encaminhamento
POST /attendance-service/referrals
Headers adicionais:
request-id: {referralRequestId}
Body:
type NewReferralInput = {
patient: {
document: string;
anamnesis: string;
birthDate: string;
gender: string;
complaint: string;
name: string;
};
specialist: {
id: string;
profile: {
specialty: {
description: string;
};
};
};
institution: {
id: string;
unity: {
id: string;
};
};
type: InstitutionAllowedReferralTypes;
anamnesisHistoryList: AnamnesisHistoryType[];
referralRequestId?: string;
inhssScore?: number;
protocol?: unknown;
};
Resposta esperada:
Observacao: arquivos de exames nao sao enviados junto nesse body. Apos criar o encaminhamento, o frontend envia cada arquivo sequencialmente para o endpoint de upload.
Upload de exames
POST /attendance-service/referrals/{referralId}/exams/upload
Content-Type:
Campo:
Limite por arquivo:
NEXT_PUBLIC_REFERRAL_EXAM_MAX_FILE_BYTES, quando definido.
- senao
NEXT_PUBLIC_REFERRAL_EXAM_MAX_FILE_MB.
- default:
20 MB.
Atualizar paciente
PUT /attendance-service/referrals/{referralId}
Body:
type UpdatePatientInput = {
name: string;
document: string;
birthDate: string;
gender: string;
complaint: string;
anamnesis: string;
};
Buscar encaminhamentos
GET /attendance-service/referrals{filters}
O parametro filters e montado pelo chamador e anexado diretamente na URL.
Detalhe por referral
GET /institution-service/referrals/{referralId}
O retorno e tratado como FirebaseReferral, usado para dados do paciente, solicitante, especialista, especialidade, chat e atendimento.
Criar avaliacao/relatorio medico
POST /attendance-service/referrals/{referralId}/medical-report
Body:
type CreateReferralEvaluationInput = {
conduct: string;
hypothesis: string;
notes?: string | null;
medicalReportHistory?: Array<{
hypothesis: string;
conduct: string;
notes: string;
enhancedByAi: boolean;
createdAt: Date;
}>;
};
Apos concluir, a aplicacao tambem cria uma notificacao:
POST /notification-service/notification
Body resumido:
{
"userId": "requester-id",
"title": "Avaliacao Concluida",
"description": "HTML com nome do especialista",
"type": "FINISHED_REPORT",
"app_name": "nextmed-web",
"metadata": "{\"referralId\":\"...\"}"
}
Marcar relatorio como visualizado
POST /attendance-service/referrals/{referralId}/report/update-viewing-status
Instituicoes e unidades
POST /institution-service/health-unity/assign/{institutionId}/{userProfileId}
GET /institution-service/health-unity/{institutionId}
GET /institution-service/institutions/specialties/{institutionId}
Body de solicitacao de vinculo:
{
"unitiesIds": ["unity-id"]
}