# 3.8.2. Configuration-based type setup

## 3.8.2.1. XSD definition

```
 <xs:complexType name="type">
    <xs:sequence>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="attributes" type="attributes" minOccurs="0" />
        <xs:element name="group-item" type="group-item" minOccurs="0" maxOccurs="unbounded" />
      </xs:choice>
    </xs:sequence>
    <xs:attribute name="code" type="xs:string" use="required" />
    <xs:attribute name="label" type="xs:string" use="required" />
    <xs:attribute name="description" type="xs:string" use="optional" />
    <xs:attribute name="visibility" type="visibility" use="optional" />
    <xs:attribute name="geometryType" type="geometryType" use="required" />
    <xs:attribute name="isGeometryEditable" type="xs:boolean" />
    <xs:attribute name="isGroup" type="xs:boolean" />
  </xs:complexType>
```

## 3.8.2.2. Attribute XSD definition <a href="#attribute-xsd-definition" id="attribute-xsd-definition"></a>

```
<!-- Common Attributes of all attributes -->
  <xs:attributeGroup name="attribute">
    <!-- name: The name of the attribute -->
    <xs:attribute name="code" type="xs:string" use="required" />
    <!-- label:The display label of the attribute -->
    <xs:attribute name="label" type="xs:string" />
    <!-- description: A description of the purpose of attribute -->
    <xs:attribute name="description" type="xs:string" />
  </xs:attributeGroup>
  <xs:complexType name="text">
    <xs:attributeGroup ref="attribute" />
  </xs:complexType>
  <xs:complexType name="term">
    <xs:sequence minOccurs="0" maxOccurs="unbounded">
      <xs:element name="option">
        <xs:complexType>
          <xs:attribute name="code" type="xs:string" use="required" />
          <!-- label:The display label of the attribute -->
          <xs:attribute name="label" type="xs:string" />
          <!-- description: A description of the purpose of attribute -->
          <xs:attribute name="description" type="xs:string" />
        </xs:complexType>
      </xs:element>
    </xs:sequence>
    <xs:attributeGroup ref="attribute" />
  </xs:complexType>
  <xs:complexType name="classification">
    <xs:attributeGroup ref="attributeClassification" />
  </xs:complexType>
  <xs:attributeGroup name="attributeClassification">
    <xs:attributeGroup ref="attribute" />
    <xs:attribute name="root" type="xs:string" use="required" />
    <xs:attribute name="classificationType" type="xs:string" use="required" />
  </xs:attributeGroup>
  <xs:attributeGroup name="attributeDec">
    <xs:attributeGroup ref="attribute" />
    <xs:attribute name="precision" type="xs:integer" />
    <xs:attribute name="scale" type="xs:integer" />
  </xs:attributeGroup>
  <!-- Represents a Boolean object in the database -->
  <xs:complexType name="boolean">
    <xs:attributeGroup ref="attribute" />
  </xs:complexType>
  <!-- Represents a Double object in the database -->
  <xs:complexType name="integer">
    <xs:attributeGroup ref="attribute" />
  </xs:complexType>
  <!-- Represents a Decimal object in the database -->
  <xs:complexType name="decimal">
    <xs:attributeGroup ref="attributeDec" />
  </xs:complexType>
  <!-- Represents a Date object in the database -->
  <xs:complexType name="date">
    <xs:attributeGroup ref="attribute" />
  </xs:complexType>
```

Example:

```
<type
    code="Health_facility"
    label="Health facility (MOH)"
    description="Public health facilities under the management of the Ministry of Health"
    visibility="PUBLIC"
    geometryType="POINT"
    isGeometryEditable="true">
    <attributes>
      <term
        code="COOR_ACU"
        label="Coordinates accuracy">
        <option
          code="COA1"
          label="Unknown" />
        <option
          code="COA2"
          label="Low" />
        <option
          code="COA3"
          label="Moderate" />
        <option
          code="COA4"
          label="High" />
      </term>
      <term
        code="SOUR_COOR"
        label="Coordinates source">
        <option
          code="SCO1"
          label="Unknown" />
        <option
          code="SCO2"
          label="Low" />
        <option
          code="SCO3"
          label="MOH (GPS)" />
        <option
          code="COA4"
          label="UN (google Map)" />
      </term>
      <term
        code="HF_OWN"
        label="Health facility Ownership">
        <option
          code="HFO1"
          label="Unknown" />
        <option
          code="HFO2"
          label="Government" />
        <option
          code="HFO3"
          label="Private" />
      </term>
      <text
        code="HD_NA_EN"
        label="Health facility head name"
        description="Full name of the health facility head in English" />
      <text
        code="HD_PS_EN"
        label="Health facility head position"
        description="Position of the health facility head in English" />
      <text
        code="D_NBR_G"
        label="Health facility phone number"
        description="General phone number of the health facility" />
      <term
        code="HF_T"
        label="Health facility type">
        <option
          code="HFT1"
          label="Unknown" />
        <option
          code="HFT2"
          label="National Hospital" />
        <option
          code="HFT3"
          label="Referral Hospital" />
        <option
          code="HFT4"
          label="Health Centre" />
        <option
          code="HFT5"
          label="Health Post" />
      </term>
      <text
        code="HF_OWN_G"
        label="Name governmental agency (ownership)"
        description="Name of the governmental agency managing the health facility" />
    </attributes>
    <group-item
      code="Referral_hospital"
      label="Referral Hospital (MOH)"
      description="Health facility were general care diagnostic services, limited surgical procedure and access to specialist consultation for patients referred from health centers are being provided" />
    <group-item
      code="National_hospital"
      label="National Hospital (MOH)"
      description="Health facility providing the same services as a referral hospital as well as a range of more highly specialized services" />
    <group-item
      code="Health_post"
      label="Health Post (MOH)"
      description="Health facility were only primary health care are being provided" />
    <group-item
      code="Health_centre"
      label="Health Centre (MOH)"
      description="Health facility were enhanced level of care is being provided" />
  </type>
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.geoprismregistry.com/readme/current-1/deployment-and-setup/3.8-configuration-based-type-setup/3.8-configuration-based-type-setup-1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
