# SanteMPI Searching

SanteMPI provides two different search pages for filtering patient data in the administrative panel. The `Search` menu item provides a user-friendly mechanism for searching patients based on their identifiers or based on various attributes on their demographic profile.

## Basic Search

The default mode of searching the MPI is to use the `_any` search method (see: [HDSI Query Syntax](/developers/service-apis/health-data-service-interface-hdsi/hdsi-query-syntax.md#freetext-search)). Searching by identifier allows a user to type (or scan) a patient identifier to retrieve patient results.<br>

![](/files/WnUZy3WHRL2NpVtA8xXv)

### Searching by Barcode

If your system is equipped with a camera, you can choose to search for a patient using a barcode. These barcodes can be:

* A QR code which contains the structured identifier information for any identifier in any identity domain (example: Driver's license, Immunization Card, etc.)
* A signed [Visual Resource Pointer API](/developers/service-apis/health-data-service-interface-hdsi/digitally-signed-visual-code-api.md) QR code generated by SanteDB.

To search by barcode, press the `Scan` option, and accept the permission to access the device camera. Hold the QR code for the patient in front of the camera and scan the information.

![](/files/M9t1uQlast9zOLAOc8AP)

* Ensure the QR code or barcode fits in the area indicated on the camera preview.
* Ensure the QR code is close to the camera and is clear
* Ensure the device with as little of an angle as possible

The action taken depends on the type of code scanned:

* If the QR code is a plain-text barcode (as can be produce by any software), SanteMPI will return search results matching this barcode identifier
* If the QR code is a [Visual Resource Pointer API](/developers/service-apis/health-data-service-interface-hdsi/digitally-signed-visual-code-api.md) QR code (which carries a digital signature) then:
  * SanteDB will verify the Digital Signature with the data in the code
  * The user will be taken directly to the resource to which the barcode points
  * If the validation for the signature failed, the user will be notified of this failure
* If the QR code is a structured payload, and the implementing country has provided a barcode parsing implementation, the QR code will be parsed and data populated in appropriate search fields.

## Advanced Search

Users can click on the `Advanced Search >` link on the search screen to open the discrete demographics search for the MPI.

The advanced search provides discrete inputs for the base identification which is provided in the Master Patient Index. <br>

![](/files/E7yFhy07FFAKne317oDS)

{% hint style="info" %}
By default the search fields are exact matches. You can force the SanteMPI server to use fuzzy matches by prepending your search term with the "approximate" operator `~` , for example: `~Jon` will search: Starts with John, within 1 levenshtein edit of Jon. Additionally `~Jo*` can be used to search "starts with Jo"
{% endhint %}

After entering the filter details for the patient search, pressing the search button will yield results.

{% hint style="info" %}
The SanteMPI server may impose minimum search criteria for search. For example, a jurisdiction may choose to return no results for searches with less than 3 search fields.
{% endhint %}

![](/files/dZfAsyB3MOPjvudvhJwn)

## Search Results

Search results are presented in a compact form on the search results page. These results contain key demographics information for the patient.

![](/files/3aO5dzgTmhSlpl9bbaut)

## Related Topics

{% content-ref url="/pages/-LyNWU60mcUHHSmNPWc0" %}
[SanteMPI Patient Detail](/user-guides-and-training/santempi/the-patient-dashboard.md)
{% endcontent-ref %}

{% content-ref url="/pages/PYlZJ8iExd1vj1GkJuh2" %}
[SanteMPI Power Search](/user-guides-and-training/santempi/santempi-power-search.md)
{% endcontent-ref %}


---

# 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/user-guides-and-training/santempi/santempi-searching.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.
