### Control Onboarding Guides Display Source: https://doc.memed.com.br/docs/frontend/comandos-mdhub/set-feature-toggle Determines whether the onboarding guide for first-time prescribers is displayed upon their initial access to the module. This helps new users navigate the platform. ```javascript await MdHub.command.send("plataforma.prescricao", "setFeatureToggle" { guidesOnboarding: true }); ``` -------------------------------- ### Frontend Integration Example Source: https://doc.memed.com.br/docs/primeiros-passos This example demonstrates how to load the Memed digital prescription script in your frontend application, including the necessary data-token. ```APIDOC ## Frontend Integration Example ### Description This example shows how to configure your frontend to load the Memed digital prescription script using the provided script URL and a user's access token. ### Method HTML Script Tag ### Endpoint N/A (Client-side script loading) ### Parameters #### HTML Attributes - **src** (string) - Required - The URL of the Memed script (e.g., `MEMED_SCRIPT_URL`). - **data-token** (string) - Required - The user's access token obtained from the backend. ### Request Example ```html ``` ### Response #### Success Response Upon successful loading, the Memed prescription module will be available in the browser's JavaScript environment. The console will indicate the environment (e.g., 'ENVIRONMENT integrations'). #### Response Example ``` ENVIRONMENT integrations we are all set!!! ``` ``` -------------------------------- ### Consultar Cidades com cURL Source: https://doc.memed.com.br/docs/backend/cidades Exemplo de requisição GET para consultar todas as cidades disponíveis na API do Memed. Não requer parâmetros adicionais, mas aceita headers padrão de autenticação e conteúdo. ```bash curl --request GET \ --url 'https://integrations.api.memed.com.br/v1/cidades' \ --header 'Accept: application/vnd.api+json' \ --header 'Cache-Control: no-cache' \ --header 'Content-Type: application/json' ``` -------------------------------- ### Consultar Cidades com Filtro de Nome via cURL Source: https://doc.memed.com.br/docs/backend/cidades Exemplo de requisição GET para consultar cidades específicas filtrando pelo nome usando o parâmetro 'filter[q]'. Retorna uma lista de cidades que correspondem ao termo de busca. ```bash curl --request GET \ --url 'https://integrations.api.memed.com.br/v1/cidades?filter[q]=Campinas' \ --header 'Accept: application/vnd.api+json' \ --header 'Cache-Control: no-cache' \ --header 'Content-Type: application/json' ``` -------------------------------- ### GET /v1/cidades Source: https://doc.memed.com.br/docs/backend/cidades Retrieves a list of cities. This endpoint can be used without any filters to get all available cities or with a filter to search for specific cities. ```APIDOC ## GET /v1/cidades ### Description Retrieves a list of cities. This endpoint can be used without any filters to get all available cities or with a filter to search for specific cities. ### Method GET ### Endpoint /v1/cidades #### Query Parameters - **filter[q]** (string) - Optional - Allows filtering cities by name. For example, `filter[q]=Campinas`. ### Request Example ```bash curl --request GET \ --url 'https://integrations.api.memed.com.br/v1/cidades' ``` ### Request Example with Filter ```bash curl --request GET \ --url 'https://integrations.api.memed.com.br/v1/cidades?filter[q]=Campinas' \ --header 'Accept: application/vnd.api+json' \ --header 'Cache-Control: no-cache' \ --header 'Content-Type: application/json' ``` ### Response #### Success Response (200) - **data** (array) - An array of city objects. - **type** (string) - The type of the resource, always 'cidades'. - **attributes** (object) - Contains the city's attributes. - **nome** (string) - The name of the city. - **uf** (string) - The state (UF) of the city. - **links** (object) - Contains a link to the specific city resource. - **self** (string) - The URL for the specific city. - **id** (integer) - The unique identifier for the city. #### Response Example ```json { "data": [ { "type": "cidades", "attributes": { "nome": "Acrelândia", "uf": "AC" }, "links": { "self": "https://integrations.api.memed.com.br/v1/cidades/1" }, "id": 1 } ] } ``` ``` -------------------------------- ### Exemplo de resposta de sucesso (HTTP 200 OK) Source: https://doc.memed.com.br/docs/backend/especialidades Este é um exemplo do formato de resposta JSON esperado quando a consulta de especialidades é bem-sucedida (status HTTP 200 OK). Contém uma lista de especialidades com seus respectivos atributos e links. ```JSON { "data": [ { "type": "especialidades", "attributes": { "nome": "Acupuntura", "grupo": "Clínica geral" }, "links": { "self": "https://integrations.api.memed.com.br/v1/especialidades/1" }, "id": 1 }, { "type": "especialidades", "attributes": { "nome": "Alergia e Imunologia", "grupo": "Clínica geral" }, "links": { "self": "https://integrations.api.memed.com.br/v1/especialidades/63" }, "id": 63 } ] } ``` -------------------------------- ### Drug Ingredients Search Response Example - JSON Source: https://doc.memed.com.br/docs/backend/prescricao Example JSON response for a drug ingredient search query, detailing the ingredient's properties and links. ```JSON { "data": [ { "type": "ingredient", "attributes": { "unii": "n.d.", "slug": "dipirona", "base": 1, "radical": null, "related": "Dipirona magnésica, Dipirona sódica, Dipirona mono-hidratada", "name": "Dipirona", "name_en": "Dipyrone" }, "links": { "self": "https:\/\/integrations.api.memed.com.br\/v1\/ingredient\/622" }, "id": 622 } ], "links": { "self": "https:\/\/integrations.api.memed.com.br\/ingredient" }, "meta": { "total": 1 } } ``` -------------------------------- ### Configurar Cabeçalho e Rodapé via API (cURL) Source: https://doc.memed.com.br/docs/como-fazer/configurar-cabecalho-rodape Utilize o comando cURL para configurar o cabeçalho e rodapé da receita digital, definindo margens, tamanhos e imagens. ```APIDOC ## POST /websites/doc_memed_br/configure_header_footer ### Description Configura o cabeçalho e rodapé da receita digital com dados adicionais, margens, tamanhos e imagens. ### Method POST ### Endpoint `/websites/doc_memed_br/configure_header_footer` ### Parameters #### Query Parameters - **margem_esquerda** (integer) - Optional - Define a margem esquerda do cabeçalho/rodapé. - **margem_direita** (integer) - Optional - Define a margem direita do cabeçalho/rodapé. - **margem_superior** (integer) - Optional - Define a margem superior do cabeçalho/rodapé. - **margem_inferior** (integer) - Optional - Define a margem inferior do cabeçalho/rodapé. - **tamanho_cabecalho** (integer) - Optional - Define o tamanho do cabeçalho. - **tamanho_rodape** (integer) - Optional - Define o tamanho do rodapé. - **mostrar_cabecalho_rodape_simples** (boolean) - Optional - Indica se deve mostrar o cabeçalho/rodapé simples. - **mostrar_cabecalho_rodape_especial** (boolean) - Optional - Indica se deve mostrar o cabeçalho/rodapé especial. - **header_image** (string) - Optional - URL da imagem a ser utilizada no cabeçalho. - **footer_image** (string) - Optional - URL da imagem a ser utilizada no rodapé. ### Request Example ```bash curl -X POST "https://api.memed.com.br/websites/doc_memed_br/configure_header_footer?margem_esquerda=10&margem_superior=20&header_image=http://example.com/header.png" ``` ### Response #### Success Response (200) - **message** (string) - Mensagem de sucesso da configuração. #### Response Example ```json { "message": "Cabeçalho e rodapé configurados com sucesso." } ``` ``` -------------------------------- ### Get Prescriber User Data and Access Token Source: https://doc.memed.com.br/docs/backend/usuario-prescritor Retrieve complete prescriber user data, including their access token, by making a GET request to the Memed API. This endpoint requires user identification and API credentials. ```APIDOC ## GET /sinapse-prescricao/usuarios/{ID_USUARIO} ### Description Retrieves the complete data of a prescriber user, including their access token. This is necessary for subsequent API calls that require user authentication. ### Method GET ### Endpoint `MEMED_API_URL/sinapse-prescricao/usuarios/{ID_USUARIO}` ### Parameters #### Path Parameters - **ID_USUARIO** (string) - Required - The identifier of the user. This can be a CPF, External ID, or a professional registration number with UF (e.g., '12345SP'). #### Query Parameters - **api-key** (string) - Required - Your Memed API Key. - **secret-key** (string) - Required - Your Memed Secret Key. ### Request Example ```bash curl --request GET \ --url 'https://integrations.api.memed.com.br/v1/sinapse-prescricao/usuarios/1234?api-key=iJGiB4kjDGOLeDFPWMG3no9VnN7Abpqe3w1jEFm6olkhkZD6oSfSmYCm&secret-key=Xe8M5GvBGCr4FStKfxXKisRo3SfYKI7KrTMkJpCAstzu2yXVN4av5nmL' \ --header 'Accept: application/vnd.api+json' \ --header 'Cache-Control: no-cache' \ --header 'Content-Type: application/json' ``` ### Response #### Success Response (200 OK) - **data** (object) - Contains the user data. - **type** (string) - The resource type, expected to be 'usuarios'. - **attributes** (object) - The user's attributes. - **nome** (string) - The user's first name. - **sobrenome** (string) - The user's last name. - **cpf** (string) - The user's CPF (Brazilian individual taxpayer registry ID). - **email** (string) - The user's email address. - **telefone** (string) - The user's phone number. - **token** (string) - The user's access token for API authentication. This token is not static and should be refreshed. - **uf** (string) - The user's state (UF). - **crm** (string) - The user's professional registration number (e.g., CRM). #### Response Example (Success) ```json { "data": { "type": "usuarios", "attributes": { "nome": "Jhon", "sobrenome": "Doe", "cpf": "84168858006", "email": "jhon@doe.com", "telefone": "(00) 00000-0000", "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.WzM2MzE3LCI2MTA0NGVkZThiMDg4YzdmMmIwMDlkNWM3NmJiMzJjMiIsIjIwMjItMTItMTciLCJzaW5hcHNlLnByZXNjcmljYW8iLCJwYXJ0bmVyLjMuMzE2NDkiXQ.Kv-VSTmXqCI-q6GPiPHF7Q8Prhz2RKy0sL0BWYfoM2I", "uf": "SP", "crm": "016964" } } } ``` #### Error Response (404 NOT FOUND) - **errors** (array) - An array of error objects. - **title** (string) - The error title, e.g., "Erro". - **detail** (string) - A detailed description of the error, e.g., "Nenhum usuário encontrado com este este CRM, CPF ou Id: 1234". #### Response Example (Error) ```json { "errors": [ { "title": "Erro", "detail": "Nenhum usuário encontrado com este este CRM, CPF ou Id: 1234" } ] } ``` ``` -------------------------------- ### Listen for Module Initialization with MdSinapsePrescricao Source: https://doc.memed.com.br/docs/frontend/mdsinapseprescricao-mdhub This snippet demonstrates how to use MdSinapsePrescricao to listen for the 'core:moduleInit' event. It includes a callback function that receives the initialized module and checks if it's the 'plataforma.prescricao' module. ```javascript MdSinapsePrescricao.event.add("core:moduleInit", function (module) {}); ``` ```javascript MdSinapsePrescricao.event.add("core:moduleInit", (module) => { if (module.name === "plataforma.prescricao") { // significa que módulo de plataforma-prescrição foi iniciado } }); ``` -------------------------------- ### GET /v1/cidades/{id} Source: https://doc.memed.com.br/docs/backend/cidades Retrieves information about a specific city by its ID. ```APIDOC ## GET /v1/cidades/{id} ### Description Retrieves detailed information for a specific city using its unique identifier. ### Method GET ### Endpoint /v1/cidades/{id} ### Parameters #### Path Parameters - **id** (integer) - Required - The unique identifier of the city. ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **id** (integer) - The unique identifier of the city. - **type** (string) - The resource type, typically 'cidades'. - **attributes** (object) - Contains the city's details. - **nome** (string) - The name of the city. - **uf** (string) - The state (UF) abbreviation where the city is located. - **links** (object) - Contains links related to the city resource. - **self** (string) - The URL to access the city resource. #### Response Example ```json { "data": { "type": "cidades", "attributes": { "nome": "Água Limpa", "uf": "GO" }, "links": { "self": "https://integrations.api.memed.com.br/v1/cidades/883" }, "id": 883 } } ``` ``` -------------------------------- ### Exemplo de Resposta de Sucesso (HTTP 200 OK) Source: https://doc.memed.com.br/docs/backend/cidades Estrutura de resposta JSON esperada quando a consulta de cidades é bem-sucedida (status HTTP 200 OK). Contém uma lista de objetos, cada um representando uma cidade com seus atributos. ```json { "data": [ { "type": "cidades", "attributes": { "nome": "Acrelândia", "uf": "AC" }, "links": { "self": "https://integrations.api.memed.com.br/v1/cidades/1" }, "id": 1 }, { "type": "cidades", "attributes": { "nome": "Assis Brasil", "uf": "AC" }, "links": { "self": "https://integrations.api.memed.com.br/v1/cidades/2" }, "id": 2 } ] } ``` -------------------------------- ### GET /especialidades Source: https://doc.memed.com.br/docs/backend/especialidades Retrieves a list of available medical specialties. This endpoint can be filtered by a query parameter. ```APIDOC ## GET /especialidades ### Description Retrieves a list of available medical specialties used for identifying a prescriber's primary area of practice. This information is also displayed on digital prescriptions. ### Method GET ### Endpoint MEMED_API_URL/especialidades ### Parameters #### Query Parameters - **filter[q]** (string) - Optional - Allows filtering specialties by a keyword. For example, to find specialties containing 'Generalista', use `filter[q]=Generalista`. ### Request Example ``` GET MEMED_API_URL/especialidades?filter[q]=Generalista ``` ### Response #### Success Response (200) - **id** (integer) - The unique identifier for the specialty. - **nome** (string) - The name of the specialty. #### Response Example ```json { "especialidades": [ { "id": 1, "nome": "Cardiologia" }, { "id": 2, "nome": "Clínica Geral" } ] } ``` ``` -------------------------------- ### GET /api/principles Source: https://doc.memed.com.br/docs/duvidas-frequentes/duvidas-back-end Allows querying the Memed database for active principles, useful for allergy registration and other related functionalities. ```APIDOC ## GET /api/principles ### Description Queries the Memed database to retrieve a list of active principles. This endpoint is useful for functionalities such as registering patient allergies. ### Method GET ### Endpoint `/api/principles` ### Parameters #### Query Parameters - **search** (string) - Optional - A search term to filter principles by name or other relevant fields. ### Response #### Success Response (200 OK) - **principles** (array) - A list of active principles. - **id** (string) - The unique identifier for the principle. - **name** (string) - The name of the active principle. #### Response Example ```json { "principles": [ { "id": "principle-001", "name": "Paracetamol" }, { "id": "principle-002", "name": "Amoxicillin" } ] } ``` ``` -------------------------------- ### Listen for Prescription Module Initialization Source: https://doc.memed.com.br/docs/primeiros-passos This snippet demonstrates how to add an event listener for the 'core:moduleInit' event to ensure the prescription module is loaded before attempting to use its commands. It uses the MdSinapsePrescricao.event.add method to register a callback function. ```javascript MdSinapsePrescricao.event.add("core:moduleInit", callbackFunction); ``` -------------------------------- ### GET /api/prescribers/{id} Source: https://doc.memed.com.br/docs/duvidas-frequentes/duvidas-back-end Retrieves detailed information about a specific prescriber, including their token, using their unique identifier. ```APIDOC ## GET /api/prescribers/{id} ### Description Retrieves information for a specific prescriber, including their authentication token. ### Method GET ### Endpoint `/api/prescribers/{id}` ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the prescriber. ### Response #### Success Response (200 OK) - **prescriberId** (string) - The unique identifier of the prescriber. - **name** (string) - The name of the prescriber. - **email** (string) - The email address of the prescriber. - **token** (string) - The current valid JWT token for the prescriber. #### Response Example ```json { "prescriberId": "prescriber-abcde", "name": "Dr. Jane Smith", "email": "jane.smith@example.com", "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." } ``` ``` -------------------------------- ### GET /v1/cidades Source: https://doc.memed.com.br/docs/backend/cidades Retrieves a list of cities. This endpoint allows fetching city data, with the ability to filter by state (UF). ```APIDOC ## GET /v1/cidades ### Description Retrieves a list of cities. This endpoint allows fetching city data, with the ability to filter by state (UF). ### Method GET ### Endpoint /v1/cidades ### Parameters #### Query Parameters - **uf** (string) - Optional - Filters cities by the specified state (e.g., 'AL', 'AP'). ### Request Example ```json { "example": "GET /v1/cidades?uf=AL" } ``` ### Response #### Success Response (200) - **data** (array) - An array of city objects. - **type** (string) - The type of the resource, always 'cidades'. - **attributes** (object) - Contains the city's details. - **nome** (string) - The name of the city. - **uf** (string) - The state abbreviation. - **links** (object) - Contains a link to the specific city resource. - **self** (string) - The URL for the city resource. - **id** (integer) - The unique identifier for the city. #### Response Example ```json { "data": [ { "type": "cidades", "attributes": { "nome": "Maceió", "uf": "AL" }, "links": { "self": "https://integrations.api.memed.com.br/v1/cidades/26" }, "id": 26 }, { "type": "cidades", "attributes": { "nome": "Amapá", "uf": "AP" }, "links": { "self": "https://integrations.api.memed.com.br/v1/cidades/124" }, "id": 124 } ] } ``` ``` -------------------------------- ### Verify and Interact with Prescription Module Source: https://doc.memed.com.br/docs/primeiros-passos This code snippet shows how to listen for the 'core:moduleInit' event and verify if the 'plataforma.prescricao' module has been initialized. Once confirmed, you can proceed to execute commands or enable/disable functionalities related to the prescription. ```javascript // Evento que fica escutando o carregamento do core:moduleInit // que contém o dentre outros o módulo de prescrição MdSinapsePrescricao.event.add("core:moduleInit", function (module) { // aqui você verifica se o módulo que retornou nesse callback é o 'plataforma.prescricao' if (module.name === "plataforma.prescricao") { // aqui você aciona os comandos // ativa e desativa funcionalidades // renderiza a prescrição na tela do usuário } }); ``` -------------------------------- ### GET /cidades Source: https://doc.memed.com.br/docs/backend/cidades Retrieves a list of available cities in the Memed platform. Authentication is not required. Filtering by name or state is supported. ```APIDOC ## GET /cidades ### Description Retrieves a list of available cities in the Memed platform. This endpoint is used to identify users by their prescriber's city, which is helpful for LME fields and regional council identification. ### Method GET ### Endpoint MEMED_API_URL/cidades ### Parameters #### Query Parameters - **filter[q]** (string) - Optional - Filters cities by name. For example, `filter[q]=Campinas` will return cities containing 'Campinas'. - **filter[uf]** (string) - Optional - Filters cities by state (UF). For example, `filter[uf]=RJ` will return all cities in the state of Rio de Janeiro. ### Request Example ``` GET MEMED_API_URL/cidades?filter[q]=Campinas ``` ### Response #### Success Response (200) - **id** (integer) - The unique identifier for the city. - **nome** (string) - The name of the city. - **uf** (string) - The state (UF) abbreviation for the city. #### Response Example ```json { "content": [ { "id": 1, "nome": "Campinas", "uf": "SP" }, { "id": 2, "nome": "São Paulo", "uf": "SP" } ], "pageable": { "sort": { "empty": false, "sorted": true, "unsorted": false }, "offset": 0, "pageNumber": 0, "pageSize": 20, "paged": true, "unpaged": false }, "last": false, "totalPages": 1, "totalElements": 2, "sort": { "empty": false, "sorted": true, "unsorted": false }, "first": true, "numberOfElements": 2, "size": 20, "number": 0, "empty": false } ``` ``` -------------------------------- ### Executar viewPrescription para reimprimir/editar prescrição Source: https://doc.memed.com.br/docs/frontend/comandos-mdhub/view-prescription Este snippet demonstra como executar o comando viewPrescription para reimprimir ou editar uma prescrição existente. Ele utiliza a estrutura básica de envio de comandos do MdHub, especificando o módulo, o comando e o ID da prescrição como parâmetros. É recomendado o uso de async/await para gerenciar a execução assíncrona. ```javascript await MdHub.command.send("plataforma.prescricao", "viewPrescription", "ID_DA_PRESCRICAO"); ``` ```javascript await MdHub.command.send("plataforma.prescricao", "viewPrescription", "1234"); ``` -------------------------------- ### GET /especialidades Source: https://doc.memed.com.br/docs/backend/especialidades Retrieves a list of medical specialties. The response includes the type, attributes (name and group), links, and ID for each specialty. ```APIDOC ## GET /especialidades ### Description Retrieves a list of medical specialties available in the Memed system. Each specialty includes its name, group, and a unique identifier. ### Method GET ### Endpoint /especialidades ### Parameters #### Query Parameters * **page** (integer) - Optional - Specifies the page number for pagination. * **per_page** (integer) - Optional - Specifies the number of items per page for pagination. ### Request Example ``` GET /especialidades?page=1&per_page=10 ``` ### Response #### Success Response (200) - **data** (array) - An array of specialty objects. - **type** (string) - The type of the resource (e.g., "especialidades"). - **attributes** (object) - Contains the details of the specialty. - **nome** (string) - The name of the medical specialty. - **grupo** (string) - The group the specialty belongs to (e.g., "Otorrinolaringologia", "Clínica médica"). - **links** (object) - Contains a link to the specific specialty resource. - **self** (string) - The URL for the specific specialty. - **id** (integer) - The unique identifier for the specialty. - **links** (object) - Contains pagination links. - **self** (string) - The URL for the current page of results. - **meta** (object) - Contains metadata about the response. - **total** (integer) - The total number of specialties available. #### Response Example ```json { "data": [ { "type": "especialidades", "attributes": { "nome": "Otorrinolaringologia e cirurgia cérvico-facial", "grupo": "Otorrinolaringologia" }, "links": { "self": "https://integrations.api.memed.com.br/v1/especialidades/43" }, "id": 43 }, { "type": "especialidades", "attributes": { "nome": "Patologia", "grupo": "Clínica médica" }, "links": { "self": "https://integrations.api.memed.com.br/v1/especialidades/52" }, "id": 52 } ], "links": { "self": "https://integrations.api.memed.com.br/especialidades?page=1&per_page=2" }, "meta": { "total": 65 } } ``` #### Error Response (400) - **errors** (array) - An array of error objects. - **code** (string) - The error code. - **title** (string) - A brief title for the error. - **detail** (string) - A detailed explanation of the error. #### Error Response Example ```json { "errors": [ { "code": "codigo_do_erro", "title": "titulo do erro", "detail": "detalhes sobre o erro" } ] } ``` ``` -------------------------------- ### Importar Cabeçalho/Rodapé de um PDF Source: https://doc.memed.com.br/docs/como-fazer/configurar-cabecalho-rodape Importa um cabeçalho e rodapé personalizados através de um arquivo em PDF pela API da Memed. ```APIDOC ## POST /websites/doc_memed_br/import_header_footer_pdf ### Description Importa um cabeçalho e rodapé personalizados a partir de um arquivo PDF. ### Method POST ### Endpoint `/websites/doc_memed_br/import_header_footer_pdf` ### Parameters #### Request Body - **pdf_file** (file) - Required - O arquivo PDF contendo o cabeçalho e rodapé a ser importado. ### Request Example ```bash curl -X POST -F "pdf_file=@/path/to/your/header_footer.pdf" https://api.memed.com.br/websites/doc_memed_br/import_header_footer_pdf ``` ### Response #### Success Response (200) - **message** (string) - Mensagem de sucesso da importação. #### Response Example ```json { "message": "Cabeçalho e rodapé importados com sucesso do arquivo PDF." } ``` ``` -------------------------------- ### Show Help Menu Toggle (JavaScript) Source: https://doc.memed.com.br/docs/frontend/comandos-mdhub/set-feature-toggle Allows the prescriber to view the help menu. This function sends a command to the 'plataforma.prescricao' service to set the 'showHelpMenu' feature toggle to true. ```javascript await MdHub.command.send("plataforma.prescricao", "setFeatureToggle" { showHelpMenu: true }); ``` -------------------------------- ### GET /v1/especialidades Source: https://doc.memed.com.br/docs/backend/especialidades Retrieves a list of all medical specialties available through the Memed API. This endpoint is useful for fetching a comprehensive list of specialties. ```APIDOC ## GET /v1/especialidades ### Description Retrieves a list of all medical specialties. ### Method GET ### Endpoint https://integrations.api.memed.com.br/v1/especialidades ### Parameters #### Query Parameters None #### Request Body None ### Request Example ```bash curl --request GET \ --url 'https://integrations.api.memed.com.br/v1/especialidades' \ --header 'Accept: application/vnd.api+json' \ --header 'Cache-Control: no-cache' \ --header 'Content-Type: application/json' ``` ### Response #### Success Response (200) - **data** (array) - A list of specialty objects. - **type** (string) - The resource type, always 'especialidades'. - **attributes** (object) - Contains the specialty's details. - **nome** (string) - The name of the specialty. - **grupo** (string) - The group the specialty belongs to. - **links** (object) - Links related to the specialty. - **self** (string) - The URL for the specific specialty resource. - **id** (integer) - The unique identifier for the specialty. #### Response Example ```json { "data": [ { "type": "especialidades", "attributes": { "nome": "Acupuntura", "grupo": "Clínica geral" }, "links": { "self": "https://integrations.api.memed.com.br/v1/especialidades/1" }, "id": 1 } ] } ``` ``` -------------------------------- ### Execute newPrescription Command Source: https://doc.memed.com.br/docs/frontend/comandos-mdhub/new-prescription This snippet demonstrates how to execute the newPrescription command using MdHub. It highlights the asynchronous nature of the command and recommends using async/await for proper handling. The command targets the 'plataforma.prescricao' module and the 'newPrescription' action. ```javascript await MdHub.command.send("plataforma.prescricao", "newPrescription"); ``` -------------------------------- ### GET /v1/protocolos/parceiros/{protocolo_id} Source: https://doc.memed.com.br/docs/backend/protocolos Retrieve a specific protocol by its ID. This is used to view the details of a single protocol. ```APIDOC ## GET /v1/protocolos/parceiros/{protocolo_id} ### Description Retrieve a specific protocol by its ID. This is used to view the details of a single protocol. ### Method GET ### Endpoint https://integrations.api.memed.com.br/v1/protocolos/parceiros/{protocolo_id} ### Parameters #### Path Parameters - **protocolo_id** (string) - Required - The ID of the protocol to retrieve. #### Query Parameters - **api-key** (string) - Required - API key for authentication. - **secret-key** (string) - Required - Secret key for authentication. ### Response #### Success Response (200) - **data** (object) - The requested protocol object. #### Response Example ```json { "data": { "type": "protocolos", "id": "some-protocol-id", "attributes": { "nome": "Protocol Name", "medicamentos": [] } } } ``` ``` -------------------------------- ### Sintaxe do comando addItem - JavaScript Source: https://doc.memed.com.br/docs/frontend/comandos-mdhub/add-item Apresenta a sintaxe de como enviar o comando `addItem` usando `MdHub.command.send`, com a recomendação de usar `async/await` para gerenciar a execução assíncrona. O comando adiciona um item à prescrição digital. ```javascript await MdHub.command.send("plataforma.prescricao", "addItem", { propriedade: "valor", }); ``` -------------------------------- ### GET /v1/cidades Source: https://doc.memed.com.br/docs/backend/cidades Retrieves a list of cities with pagination support. Each city object includes its type, attributes (name and UF), links, and a unique ID. ```APIDOC ## GET /v1/cidades ### Description Retrieves a list of cities, supporting pagination. The response includes city details such as name, UF, and links, along with pagination metadata. ### Method GET ### Endpoint /v1/cidades ### Query Parameters - **page[offset]** (integer) - Optional - The offset for pagination, determining which page of results to retrieve. ### Request Example ``` GET /v1/cidades?page[offset]=100 ``` ### Response #### Success Response (200) - **data** (array) - An array of city objects. - **type** (string) - The type of the resource, e.g., "cidades". - **attributes** (object) - Contains the city's properties. - **nome** (string) - The name of the city. - **uf** (string) - The state (UF) abbreviation. - **links** (object) - Links related to the city resource. - **self** (string) - The URL for the specific city resource. - **id** (integer) - The unique identifier for the city. - **links** (object) - Pagination links. - **next** (string) - URL for the next page of results. - **last** (string) - URL for the last page of results. - **self** (string) - URL for the current page of results. - **meta** (object) - Metadata about the response. - **total** (integer) - The total number of cities available. - **limit** (integer) - The number of cities returned per page. #### Response Example ```json { "data": [ { "type": "cidades", "attributes": { "nome": "Acorizal", "uf": "MT" }, "links": { "self": "https://integrations.api.memed.com.br/v1/cidades/1338" }, "id": 1338 } ], "links": { "next": "https://integrations.api.memed.com.br/v1/cidades?page[offset]=100", "last": "https://integrations.api.memed.com.br/v1/cidades?page[offset]=166", "self": "https://integrations.api.memed.com.br/cidades" }, "meta": { "total": 266, "limit": 100 } } ``` ``` -------------------------------- ### GET /v1/especialidades Source: https://doc.memed.com.br/docs/backend/especialidades Retrieves a list of all medical specialties available in the system. Each specialty includes its ID, type, attributes (name and group), and a self-referential link. ```APIDOC ## GET /v1/especialidades ### Description Retrieves a list of all medical specialties. Each item in the list contains the specialty's ID, type, attributes (name and group), and a link to its specific resource. ### Method GET ### Endpoint /v1/especialidades ### Parameters #### Query Parameters None ### Request Example None ### Response #### Success Response (200) - **data** (array) - An array of specialty objects. - **id** (integer) - The unique identifier for the specialty. - **type** (string) - The type of the resource, always 'especialidades'. - **attributes** (object) - Contains the details of the specialty. - **nome** (string) - The name of the medical specialty. - **grupo** (string) - The group the specialty belongs to (e.g., 'Clínica médica', 'Gastroenterologia', 'Null'). - **links** (object) - Contains links related to the specialty. - **self** (string) - The URL for the specific specialty resource. #### Response Example ```json { "data": [ { "type": "especialidades", "attributes": { "nome": "Genética médica", "grupo": "Clínica médica" }, "links": { "self": "https://integrations.api.memed.com.br/v1/especialidades/56" }, "id": 56 }, { "type": "especialidades", "attributes": { "nome": "Geriatria e gerontologia", "grupo": "Clínica geral" }, "links": { "self": "https://integrations.api.memed.com.br/v1/especialidades/20" }, "id": 20 } ] } ``` ``` -------------------------------- ### Consultar todas as especialidades médicas via cURL Source: https://doc.memed.com.br/docs/backend/especialidades Este snippet demonstra como realizar uma requisição GET para a API da Memed para listar todas as especialidades médicas disponíveis. Não requer parâmetros adicionais além dos headers de autenticação e conteúdo. ```cURL curl --request GET \ --url 'https://integrations.api.memed.com.br/v1/especialidades' \ --header 'Accept: application/vnd.api+json' \ --header 'Cache-Control: no-cache' \ --header 'Content-Type: application/json' ```