Patient Metadata Create form
This allows developers to dynamically display additional fields in the patient profile. For more guidance, see the “How to add additional profile fields” guide.
Build a PatientMetadataCreateFormEffect with the form fields to show, then return its apply() from a PATIENT_METADATA__GET_ADDITIONAL_FIELDS handler.
Methods #
apply() → Effect #
Displays the form fields in the patient profile.
form_fieldsis required.optionsmay only be set on fields whosetypeisInputType.SELECT.
Attributes #
| Attribute | Type | Description | Required |
|---|---|---|---|
form_fields | list[FormField] | List of fields. | Yes |
FormField #
| Attribute | Type | Description |
|---|---|---|
key | str | Unique identifier of the field; the patient metadata key. |
label | str | The label displayed on the field. |
type | InputType | The type of the input: TEXT, SELECT, or DATE. Defaults to TEXT. |
required | bool | Whether the input is required. Defaults to False. |
editable | bool | Whether the input can be edited. Defaults to True. |
options | list[str] | Possible options when the input type is SELECT. Only allowed on SELECT fields. |
Example #
from canvas_sdk.effects.patient_metadata import PatientMetadataCreateFormEffect, InputType, FormField
PatientMetadataCreateFormEffect(form_fields=[
FormField(
key='status',
label='Status',
type=InputType.SELECT,
required=False,
editable=True,
options=["open", "close"]
),
]).apply()