# Questionnaires

Canonical page: https://docs.ovok.com/python-sdk/namespaces/questionnaires

`ovok.questionnaires` prepares a Questionnaire for the user to fill in. Read Questionnaires
with [`ovok.patient.questionnaires`](/python-sdk/namespaces/patient) and submit answers with
[`ovok.questionnaire_responses`](/python-sdk/namespaces/questionnaire-responses).

## Pre-fill a questionnaire [#pre-fill-a-questionnaire]

`populate` runs FHIR `$populate` and returns a draft QuestionnaireResponse with the answers
the server already knows.

```python
from ovok_sdk import Ovok

ovok = Ovok("https://api.sandbox.ovok.com", "your-tenant")
ovok.auth.login(profile_type="Patient", email="patient@example.com", password="password")

result = ovok.questionnaires.populate("questionnaire-id")
```

## Pass populate parameters [#pass-populate-parameters]

Pass a FHIR Parameters resource to choose the subject or other context:

```python
ovok.questionnaires.populate("questionnaire-id", {
    "resourceType": "Parameters",
    "parameter": [{"name": "subject", "valueReference": {"reference": "Patient/patient-id"}}],
})
```

## API reference [#api-reference]

See [`ovok_sdk.resources.questionnaires`](/python-sdk/reference/resources/questionnaires)
for every method, parameter and error.
