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_fields is required.
  • options may only be set on fields whose type is InputType.SELECT.

Attributes #

AttributeTypeDescriptionRequired
form_fieldslist[FormField]List of fields.Yes

FormField #

AttributeTypeDescription
keystrUnique identifier of the field; the patient metadata key.
labelstrThe label displayed on the field.
typeInputTypeThe type of the input: TEXT, SELECT, or DATE. Defaults to TEXT.
requiredboolWhether the input is required. Defaults to False.
editableboolWhether the input can be edited. Defaults to True.
optionslist[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()