# SanteDB XML Schemas

When editing an asset in SanteDB which is in XML format, the use of an XML Schema can greatly assist the development process. The SanteDB community provides schemas for developers to use in their XML files at `http://santedb.org/schema/v3.0`or `http://santedb.org/schema/v2.2`.

## Schemas

The schema location in the table below assumes a root of `http://santedb.org/schema/v3.0/`for example `http://santedb.org/schema/v3.0/Applet.xsd`would reference the applet manifest schema.

| Schema Location            | Uses                                                                                                                                                                                          |
| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Applet.xsd`               | Applet Manifest (`manifest.xml`) - [Applet Structure](/developers/applets/applet-structure.md#manifest-file)                                                                                  |
| `Audit.xsd`                | HDSI format Audit messages                                                                                                                                                                    |
| `BusinessIntelligence.xsd` | Any BI asset: `BiIndicatorDefinition`, `BiQueryDefinition`, `BiViewDefinition`, `BiReportDefinition` - [Business Intelligence Assets](/developers/applets/business-intelligence-bi-assets.md) |
| `Cdss.xsd`                 | Clinical Decision Support rules expressed in XML - [CDSS Definitions](/developers/applets/cdss-protocols/cdss-definitions.md)                                                                 |
| `Dataset.xsd`              | Any dataset file (seeding data) [Dataset Files](/developers/applets/distributing-data.md)                                                                                                     |
| `DetectedIssue.xsd`        | HDSI format detected issue templates                                                                                                                                                          |
| `ForeignData.xsd`          | Any Foreign Data Map definition file ( [External Data Maps](/developers/applets/external-data-maps.md))                                                                                       |
| `MatcherDefinition.xsd`    | Any match configuration file - [Matching Engine](/santedb/matching-engine.md)                                                                                                                 |
| `ModelMap.xsd`             | For .NET plugins where a persistence layer (physical layer) class definition must be mapped to a business layer object.                                                                       |
| `ViewModelDescription.xsd` | For defining view model definition files which control how the HDSI - [Health Data Service Interface (HDSI)](/developers/service-apis/health-data-service-interface-hdsi.md#viewmodel-json)   |

## Referencing Schemas

To reference a schema in your XML file, simply:

* Declare the `http://www.w3.org/2001/XMLSchema-instance`namespace on your root element
* Use the `xsi:schemaLocation`attribute to point to the intended schema

For example, if defining BI Indicator:

```xml
<BiIndicatorDefinition 
    xmlns="http://santedb.org/bi"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://santedb.org/bi http://santedb.org/schema/v3.0/BusinessIntelligence.xsd"
    id="org.example.indicator"
    name="Example Indicator"
    label="ui.org.example.indicator.label">
</BiIndicatorDefinition>
```


---

# 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://help.santesuite.org/developers/santedb-xml-schemas.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.
