---
id: "th_hcode"
kind: "datatype"
status: "draft"
is_pii: false
name: "Thai health facility code (hcode)"
regexp: "^(?:\\d{5}|\\d{9})$"
categories: ["medical", "government"]
country: ["TH"]
langs: ["common"]
quality: 90
url: "https://registry.apicrafter.io/datatype/th_hcode"
---

# Thai health facility code (hcode) (`th_hcode`)

> **Draft.** Draft records have not been reviewed yet and may be incomplete or wrong; do not treat them as authoritative for legal or compliance decisions.

Code of a health facility of Thailand (hospital, health promoting hospital, clinic) issued by the Strategy and Planning Division of the Office of the Permanent Secretary of the Ministry of Public Health. It has a five-digit form (10741) and a nine-digit form; in the facility lists of the City Data Platform the nine-digit form holds the five digits between two pairs of zeros (001074100). Health records and claims name the facility by it, in columns named hcode, hospcode or รหัส5หลัก and รหัส9หลัก.

- Personal data (PII): no
- Categories: Medical/pharma identifiers (medical), Government related (government)
- Countries: Thailand (TH)
- Languages: Common to most languages (common)
- Classification: identifier

## Detection

Regular expression (Python `re`):

```
^(?:\d{5}|\d{9})$
```

## Examples

- `10741` — Vachira Phuket Hospital
- `001074100` — the same hospital in the nine-digit form
- `09137` — a health promoting hospital
- `1074` (invalid example) — four digits

## Metacrafter rules

1 rules: 1 match the field name, 0 match values.

- `thhcodebyname` (field, `th/th_codes.yaml`)

## Supported by tools

- [`metacrafter`](https://registry.apicrafter.io/tool/metacrafter.md)

## Translations

- th: รหัสสถานบริการสุขภาพ
- ru: Код медицинского учреждения Таиланда (hcode)

## Sources

- doc: <https://hcode.moph.go.th/>

## Quality

Score 90/100. Missing: mapping (Wikidata, Schema.org, ...).

JSON: <https://registry.apicrafter.io/api/v1/datatypes/th_hcode.json> · Edit: <https://github.com/apicrafter/metacrafter-registry/edit/main/data/datatypes/TH/medical/th_hcode.yaml>
