Skip to main content
Clínica nas Nuvens is a Brazilian cloud-based clinic management software designed for healthcare professionals. It provides tools for managing appointments, patients, procedures, and billing, helping clinics streamline their operations and improve patient care.

Configuring Clínica nas Nuvens as a Source

In the Sources tab, click on the “Add source” button located on the top right of your screen. Then, select the Clínica nas Nuvens option from the list of connectors. Click Next and you’ll be prompted to add your access.

1. Add account access

You’ll need to provide your API credentials to access your Clínica nas Nuvens data. These credentials can be found in your Clínica nas Nuvens account under Menu > Integrações > API. The following configurations are available:
  • Client ID: The client ID to authenticate against the Clínica nas Nuvens API.
  • Client Secret: The client secret to authenticate against the Clínica nas Nuvens API.
  • Token: The token to authenticate against the Clínica nas Nuvens API.
  • Start Date: The earliest date from which records will be synced. This is used for date-based streams like Agenda (appointments).
Once you’re done, click Next.

2. Select streams

Choose which data streams you want to sync. For faster extractions, select only the streams that are relevant to your analysis. You can select entire groups of streams or pick specific ones.
Tip: The stream can be found more easily by typing its name.
Select the streams and click Next.

3. Configure data streams

Customize how you want your data to appear in your catalog. Select the desired layer where the data will be placed, a folder to organize it inside the layer, a name for each table (which will effectively contain the fetched data) and the type of sync.
  • Layer: choose between the existing layers on your catalog. This is where you will find your new extracted tables as the extraction runs successfully.
  • Folder: a folder can be created inside the selected layer to group all tables being created from this new data source.
  • Table name: we suggest a name, but feel free to customize it. You have the option to add a prefix to all tables at once and make this process faster!
  • Sync Type: FULL_TABLE sync is used for all streams.
Incremental sync is not supported. The Clínica nas Nuvens API does not provide reliable filters by modification date, so all streams use full table sync. Each extraction will fetch the complete current state of the data.
Once you are done configuring, click Next.

4. Configure data source

Describe your data source for easy identification within your organization, not exceeding 140 characters. To define your Trigger, consider how often you want data to be extracted from this source. This decision usually depends on how frequently you need the new table data updated (every day, once a week, or only at specific times). Optionally, you can define some additional settings:
  • Configure Delta Log Retention and determine for how long we should store old states of this table as it gets updated. Read more about this resource here.
  • Determine when to execute an Additional Full Sync. This will complement the incremental data extractions, ensuring that your data is completely synchronized with your source every once in a while.
Once you are ready, click Next to finalize the setup.

5. Check your new source

You can view your new source on the Sources page. If needed, manually trigger the source extraction by clicking on the arrow button. Once executed, your data will appear in your Catalog.
For you to be able to see it on your Catalog, you need at least one successful source run.

Streams and Fields

Below you’ll find all available data streams from Clínica nas Nuvens and their corresponding fields:
Stream containing scheduled appointments and their details.Key Fields:
  • id - Unique identifier for the appointment
  • data - Date of the scheduled appointment
  • horaInicio - Start time of the appointment
  • horaFim - End time of the appointment
  • status - Appointment status
Patient Information:
  • idPaciente - ID of the patient
  • emailPaciente - Patient’s email address
  • telefoneCelularPaciente - Patient’s mobile phone number
  • idOrigemPaciente - ID of the patient’s origin/source
Appointment Details:
  • idLocalAgenda - ID of the schedule location
  • idPessoaExecutor - ID of the person performing the appointment
  • idTipoConsulta - ID of the consultation type
  • idTipoConvenio - ID of the agreement/insurance type
  • idRotulo - ID of the label
  • encaminhamento - Referral information
  • observacoes - Observations about the appointment
  • urlSalaEspera - URL of the virtual waiting room
Procedures:
  • procedimentos[] - Array of procedures for the appointment:
    • procedimentos[].id - Procedure ID
    • procedimentos[].nome - Procedure name
    • procedimentos[].idEspecialidade - Specialty ID
    • procedimentos[].idTipoProcedimento - Procedure type ID
    • procedimentos[].idPromocao - Promotion ID
    • procedimentos[].quantidade - Quantity
Stream containing patient records and their personal information.Key Fields:
  • id - Unique identifier for the patient
  • nome - Patient’s full name
  • nomeSocial - Patient’s social name
  • ativo - Indicates whether the patient is active
Personal Information:
  • cpfcnpj - Patient’s CPF or CNPJ document number
  • dataNascimento - Patient’s date of birth
  • sexo - Patient’s biological sex
  • genero - Patient’s gender
  • idNacionalidade - ID of the patient’s nationality
  • estrangeiro - Indicates if the patient is a foreigner
  • numeroControle - Patient’s control number
  • numeroIdentificacao - Patient’s identification number
  • idOrigem - Origin/source identifier
Contact Information (contato):
  • contato.email - Patient’s email address
  • contato.telefoneCelular - Mobile phone number
  • contato.telefoneResidencial - Residential phone number
  • contato.telefoneComercial - Commercial phone number
  • contato.telefoneRecados - Message phone number
  • contato.skype - Skype username
  • contato.ramalTelefoneResidencial - Residential phone extension
  • contato.ramalTelefoneComercial - Commercial phone extension
  • contato.ramalTelefoneRecados - Message phone extension
Address Information (endereco):
  • endereco.rua - Street name
  • endereco.numero - Address number
  • endereco.complemento - Address complement
  • endereco.bairro - Neighborhood
  • endereco.cep - ZIP/postal code
  • endereco.idCidade - City ID (joins with Cidades stream)
Lookup table containing city information with state details.Key Fields:
  • id - Unique identifier for the city
  • nome - City name
  • codIbge - IBGE code (Brazilian official city code)
State Information (estado):
  • estado.id - State identifier
  • estado.nome - State name
  • estado.sigla - State abbreviation (e.g., SP, RJ, MG)
Lookup table containing medical specialties.Key Fields:
  • id - Unique identifier for the specialty
  • nome - Specialty name (e.g., Cardiologia, Dermatologia)
Lookup table containing nationalities.Key Fields:
  • id - Unique identifier for the nationality
  • nacionalidade - Nationality name (e.g., Brasileira, Portuguesa)
Lookup table containing patient origin/source information. Tracks how patients discovered or were referred to the clinic.Key Fields:
  • id - Unique identifier for the origin
  • nome - Origin name (e.g., “Indicação”, “Google”, “Convênio”)
  • ativo - Indicates if the origin is active
Lookup table containing schedule/appointment origin information.Key Fields:
  • id - Unique identifier for the schedule origin
  • nome - Schedule origin name
  • ativo - Indicates if the record is active
Lookup table containing agreement/insurance types (convênios).Key Fields:
  • id - Unique identifier for the agreement type
  • nome - Agreement type name
  • ativo - Indicates if the agreement type is active
  • particular - Indicates if it’s a private/self-pay option
  • beneficio - Indicates benefit status
Lookup table containing procedure types with associated specialties.Key Fields:
  • id - Unique identifier for the procedure type
  • nome - Procedure type name
  • ativo - Indicates if the procedure type is active
Associated Specialties:
  • especialidades[] - Array of specialties that can perform this procedure:
    • especialidades[].id - Specialty ID
    • especialidades[].nome - Specialty name

Data Model

The following diagram illustrates the relationships between the core data streams in Clínica nas Nuvens. The arrows indicate the join keys that link the different entities, providing a clear overview of the data structure.

Use Cases for Data Analysis

This guide outlines valuable business intelligence use cases when consolidating Clínica nas Nuvens data, along with ready-to-use SQL queries that you can run on Explorer.

1. Appointment Volume Analysis

Track appointment volumes over time to understand clinic capacity and identify trends. Business Value:
  • Understand daily and weekly appointment patterns
  • Identify peak hours and days for resource planning
  • Monitor appointment status distribution
WITH appointment_metrics AS (
    SELECT
        DATE(a.data) AS appointment_date,
        DATE_FORMAT(DATE(a.data), '%W') AS day_of_week,
        a.status,
        COUNT(*) AS total_appointments,
        COUNT(DISTINCT a.idPaciente) AS unique_patients
    FROM
        nekt_raw.clinica_nas_nuvens_agenda a
    WHERE
        DATE(a.data) >= CURRENT_DATE - INTERVAL '30' DAY
    GROUP BY
        DATE(a.data),
        DATE_FORMAT(DATE(a.data), '%W'),
        a.status
)
SELECT
    appointment_date,
    day_of_week,
    status,
    total_appointments,
    unique_patients
FROM
    appointment_metrics
ORDER BY
    appointment_date DESC,
    total_appointments DESC
appointment_dateday_of_weekstatustotal_appointmentsunique_patients
2024-11-27WednesdayConfirmado4542
2024-11-27WednesdayAguardando1212
2024-11-27WednesdayCancelado33
2024-11-26TuesdayConfirmado5248
2024-11-26TuesdayAguardando88

2. Patient Origin Analysis

Understand where your patients are coming from to optimize marketing efforts. Business Value:
  • Identify most effective patient acquisition channels
  • Measure ROI of marketing initiatives
  • Optimize patient acquisition strategy
SELECT
    o.nome AS origem,
    COUNT(DISTINCT p.id) AS total_patients,
    COUNT(DISTINCT CASE WHEN p.ativo = true THEN p.id END) AS active_patients,
    ROUND(
        COUNT(DISTINCT CASE WHEN p.ativo = true THEN p.id END) * 100.0 / 
        NULLIF(COUNT(DISTINCT p.id), 0), 
        1
    ) AS active_rate_pct
FROM
    nekt_raw.clinica_nas_nuvens_pacientes p
    LEFT JOIN nekt_raw.clinica_nas_nuvens_origem o ON p.idOrigem = o.id
GROUP BY
    o.nome
ORDER BY
    total_patients DESC
origemtotal_patientsactive_patientsactive_rate_pct
Indicação1,2451,10288.5
Google85672384.5
Convênio63458992.9
Instagram42336786.8
Site31225682.1

3. Procedure and Specialty Analysis

Analyze which procedures and specialties are most in demand. Business Value:
  • Identify most popular procedures
  • Understand specialty distribution
  • Plan resource allocation based on demand
WITH procedure_data AS (
    SELECT
        p.id AS procedure_id,
        p.nome AS procedure_name,
        p.idEspecialidade AS specialty_id,
        p.quantidade AS quantity,
        a.id AS appointment_id,
        a.data AS appointment_date
    FROM
        nekt_raw.clinica_nas_nuvens_agenda a
        CROSS JOIN UNNEST(a.procedimentos) AS t(p)
    WHERE
        DATE(a.data) >= CURRENT_DATE - INTERVAL '30' DAY
)
SELECT
    e.nome AS specialty,
    tp.nome AS procedure_type,
    COUNT(DISTINCT pd.appointment_id) AS total_appointments,
    SUM(pd.quantity) AS total_procedures
FROM
    procedure_data pd
    LEFT JOIN nekt_raw.clinica_nas_nuvens_especialidades e ON pd.specialty_id = e.id
    LEFT JOIN nekt_raw.clinica_nas_nuvens_tipo_procedimento tp ON pd.procedure_id = tp.id
GROUP BY
    e.nome,
    tp.nome
ORDER BY
    total_appointments DESC
specialtyprocedure_typetotal_appointmentstotal_procedures
DermatologiaConsulta234234
CardiologiaConsulta189189
DermatologiaProcedimento Estético156312
OftalmologiaConsulta145145
PediatriaConsulta123123

Implementation Notes

Data Quality Considerations

  • The Agenda stream uses the start_date configuration to filter appointments by date
  • Patient records may have null values for optional contact and address fields
  • Use the lookup tables (Cidades, Especialidades, etc.) to enrich your analyses with descriptive names

Best Practices

  • Always join with lookup tables to get descriptive names instead of just IDs
  • Consider patient privacy when analyzing personal data