Paste this into your system prompt
The conversational questionnaire protocol
1
start
hidoctor_questionnaire_start with a category_slug (weight-loss,
hair-growth, sexual-health, …). Returns the first unanswered question
plus answered_count and applicable_total so you can show progress.If the patient already had a part-finished questionnaire, it resumes where
they left off.2
answer, repeatedly
hidoctor_questionnaire_answer records one answer and returns the next
question. The server decides what comes next, so branching is handled for
you — you never evaluate a condition yourself.Answers are merged, not replaced. Nothing is lost between calls, and the
patient can stop and come back later.3
review and correct
hidoctor_questionnaire_review returns every answer so far in readable
form. hidoctor_questionnaire_back steps to the previous question so an
answer can be changed.Changing an answer can close a branch. When that happens the response lists
dropped_question_keys — answers that no longer apply and were removed.
Mention it if it matters to the patient.4
submit
hidoctor_questionnaire_submit returns an outcome:Answer shapes
The question tells you how to answer it. Readkind:
Follow-up nodes carry an
answer_instructions string saying exactly where the
value belongs. Follow it.
The rules above are not technically enforced
Hi-Doctor cannot tell whether an answer came from the patient or was inferred by the assistant. Nothing in the API validates that. What the server does enforce is eligibility.Eligibility is decided by the server
Contraindications, the BMI threshold, the age limit and the supported-country check are enforced when the questionnaire is submitted — not by the assistant and not by the website.Things that will bite you
Send option values, not labels
Send option values, not labels
Labels are human text and are translated into the patient’s language.
value is the stable identifier the server expects.The questionnaire is in the patient's language
The questionnaire is in the patient's language
Question text comes back in the language on the patient’s profile. Ask in
that language.
Payment happens on Stripe, not in chat
Payment happens on Stripe, not in chat
hidoctor_checkout_create returns a link. Never ask for card details — you
have no way to take them, and asking trains patients to hand card numbers
to chatbots.Progress tracking is weight-loss only
Progress tracking is weight-loss only
Every permission is granted on a normal patient connect, payment included.
But the progress journal is built around weight, injections and an injection
plan, so it is only available on weight-loss treatment — not on
hair-growth or sexual-health plans.Call
hidoctor_progress_status before offering to track anything. If a tool
is missing entirely, the patient declined that permission at connect time —
say so rather than guessing at a workaround.Weight is one entry per day; notes and injections are not
Weight is one entry per day; notes and injections are not
Logging weight for a date replaces that day’s entry. Notes and injections
append, so logging twice creates two.