webdiet_preconsulta_write_link_to_patient
Vincular (link) a pre-consultation response to an existing patient in WebDiet. Action: link_to_patient — imports the response content into the patient's chart. WebDiet routes automatically based on the response's "origem": • origem=anamnese → response becomes a new anamnese (importarPreanamnese.php) • origem=questionario → response becomes a new diagnostico (criarDiagnosticoPre.php) This is the API-equivalent of the panel's "Vincular ao paciente" button on the Respostas dos questionários page. After linking, the response remains in the responses list — use webdiet_preconsulta_delete to remove it if desired. Tip: when the response's respondedor.nome differs from the patient's nome (e.g. "DALILA JULIAO MARTINS" vs "Dalila CG"), match by telefone or nascimento via webdiet_patient list before linking.
[Flattened action: link_to_patient]
Bulk support: accepts patient_ids, response_ids for batched execution.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| account | No | ||
| patient_id | Yes | ||
| patient_ids | No | ||
| response_id | Yes | ||
| response_ids | No |