<configure
    xmlns="http://namespaces.zope.org/zope"
    i18n_domain="senaite.health">

  <!-- Package includes -->
  <include package=".guards" />
  <include package=".listing" />
  <include package=".referencewidget" />
  <include package=".widgetvisibility" />

  <!-- Default value for Client field in Add Sample form -->
  <adapter
    factory=".addsample.ClientDefaultFieldValue"
    for="*"
    provides="bika.lims.interfaces.IGetDefaultFieldValueARAddHook"
    name = "Client_default_value_hook" />

  <!-- Default value for Patient field in Add Sample form -->
  <adapter
    factory=".addsample.PatientDefaultFieldValue"
    for="*"
    provides="bika.lims.interfaces.IGetDefaultFieldValueARAddHook"
    name = "Patient_default_value_hook" />

  <!-- Default value for ClientPatientID field in Add Sample form -->
  <adapter
    factory=".addsample.PatientDefaultFieldValue"
    for="*"
    provides="bika.lims.interfaces.IGetDefaultFieldValueARAddHook"
    name = "ClientPatientID_default_value_hook" />

  <!-- Default value for Doctor field in Add Sample form -->
  <adapter
    factory=".addsample.DoctorDefaultFieldValue"
    for="*"
    provides="bika.lims.interfaces.IGetDefaultFieldValueARAddHook"
    name = "Doctor_default_value_hook" />

  <!-- Default value for Batch (Case) field in Add Sample form -->
  <adapter
    factory=".addsample.BatchDefaultFieldValue"
    for="*"
    provides="bika.lims.interfaces.IGetDefaultFieldValueARAddHook"
    name="Batch_default_value_hook" />

  <!-- Additional metadata for Client field in Add Sample form
  Changes the default behavior of Add Sample when the Client is selected:
  E.g. search filtering of other fields like Patient, default values for other
  fields, etc.
  -->
  <adapter
    factory=".addsample.AddSampleClientInfo"
    for="bika.lims.interfaces.IClient"
    provides="bika.lims.interfaces.IAddSampleObjectInfo"
    name="senaite.health.addsample_client_info" />

  <!-- Additional metadata for Batch field in Add Sample form -->
  <adapter
    factory=".addsample.AddSampleBatchInfo"
    for="bika.lims.interfaces.IBatch"
    provides="bika.lims.interfaces.IAddSampleObjectInfo"
    name="senaite.health.addsample_batch_info" />

  <!-- Additional metadata for Patient field in Add Sample form -->
  <adapter
    factory=".addsample.AddSamplePatientInfo"
    for="bika.health.interfaces.IPatient"
    provides="bika.lims.interfaces.IAddSampleObjectInfo"
    name="senaite.health.addsample_patient_info" />

  <!-- Flushing of custom fields for Add Sample form -->
  <adapter
    factory=".addsample.AddSampleFieldsFlush"
    for="*"
    provides="bika.lims.interfaces.IAddSampleFieldsFlush"
    name="senaite.health.addsample_fields_flush"
  />

</configure>
