1. プロファイル — バインディング リソース
1 つ プロフィール (StructureDefinition) は、基本 FHIR リソースに制約を追加します。つまり、必須の要素、制限された基数、バインディング用語、追加された拡張機能です。
FHIR 短縮表記 (FSH) を使用したプロファイルの例
Profile: VNPatient
Parent: Patient
Id: vn-patient
Title: "VN Core Patient Profile"
Description: "Patient profile cho y tế Việt Nam, yêu cầu CCCD, ngày sinh, giới tính"
// Bắt buộc các elements
* identifier 1..* MS
* identifier ^slicing.discriminator.type = #pattern
* identifier ^slicing.discriminator.path = "type"
* identifier ^slicing.rules = #open
* identifier contains
cccd 0..1 MS and
bhyt 0..1 MS
* identifier[cccd].system = "http://cccd.gov.vn" (exactly)
* identifier[cccd].type = http://terminology.hl7.org/CodeSystem/v2-0203#NI
* identifier[cccd].value 1..1
* identifier[bhyt].system = "http://bhxh.gov.vn/bhyt" (exactly)
* identifier[bhyt].type = http://terminology.hl7.org/CodeSystem/v2-0203#SB
* name 1..* MS
* gender 1..1 MS
* birthDate 1..1 MS
// Extension
* extension contains
VNEthnicity named ethnicity 0..1 MS and
VNNationality named nationality 0..1 MS
// Binding
* maritalStatus from http://hl7.org/fhir/ValueSet/marital-status (extensible)
構造定義(JSON)
{
"resourceType": "StructureDefinition",
"url": "http://fhir.vn/StructureDefinition/vn-patient",
"name": "VNPatient",
"title": "VN Core Patient Profile",
"status": "active",
"kind": "resource",
"abstract": false,
"type": "Patient",
"baseDefinition": "http://hl7.org/fhir/StructureDefinition/Patient",
"derivation": "constraint",
"differential": {
"element": [
{
"id": "Patient.identifier",
"path": "Patient.identifier",
"min": 1,
"mustSupport": true,
"slicing": {
"discriminator": [
{"type": "pattern", "path": "type"}
],
"rules": "open"
}
},
{
"id": "Patient.identifier:cccd",
"path": "Patient.identifier",
"sliceName": "cccd",
"min": 0,
"max": "1",
"mustSupport": true
},
{
"id": "Patient.identifier:cccd.system",
"path": "Patient.identifier.system",
"fixedUri": "http://cccd.gov.vn"
},
{
"id": "Patient.identifier:cccd.value",
"path": "Patient.identifier.value",
"min": 1
},
{
"id": "Patient.name",
"path": "Patient.name",
"min": 1,
"mustSupport": true
},
{
"id": "Patient.gender",
"path": "Patient.gender",
"min": 1,
"mustSupport": true
},
{
"id": "Patient.birthDate",
"path": "Patient.birthDate",
"min": 1,
"mustSupport": true
}
]
}
}
2. 拡張機能
拡張機能を使用すると、ベースの FHIR リソースにないデータを追加できます。これがメカニズムです。 拡張性 コア。
単純な拡張
Extension: VNEthnicity
Id: vn-ethnicity
Title: "Dân tộc Việt Nam"
Description: "Mã dân tộc theo danh mục 54 dân tộc Việt Nam"
Context: Patient
* value[x] only CodeableConcept
* valueCodeableConcept from VNEthnicityVS (required)
{
"resourceType": "Patient",
"extension": [
{
"url": "http://fhir.vn/StructureDefinition/vn-ethnicity",
"valueCodeableConcept": {
"coding": [
{
"system": "http://fhir.vn/CodeSystem/vn-ethnicity",
"code": "01",
"display": "Kinh"
}
]
}
}
]
}
複雑な拡張機能
Extension: VNAddress
Id: vn-address
Title: "Địa chỉ hành chính Việt Nam"
Context: Address
* extension contains
province 1..1 MS and
district 1..1 MS and
ward 0..1 MS
* extension[province].value[x] only CodeableConcept
* extension[province].valueCodeableConcept from VNProvinceVS (required)
* extension[district].value[x] only CodeableConcept
* extension[district].valueCodeableConcept from VNDistrictVS (required)
* extension[ward].value[x] only CodeableConcept
* extension[ward].valueCodeableConcept from VNWardVS (required)
モディファイア拡張子
修飾子拡張子 意味を変える それを含む要素の — 受信者はこの拡張を理解する必要があります。
{
"resourceType": "AllergyIntolerance",
"modifierExtension": [
{
"url": "http://hospital.vn/fhir/StructureDefinition/allergy-certainty",
"valueCode": "unconfirmed"
}
]
}
3. スライス
スライスでは、繰り返し要素 (カーディナリティ 0..*) が、異なる制約を持つ個別の「スライス」に分割されます。
* identifier ^slicing.discriminator.type = #pattern
* identifier ^slicing.discriminator.path = "type"
* identifier ^slicing.rules = #open
* identifier ^slicing.ordered = false
* identifier contains
cccd 0..1 MS and // Slice cho CCCD
bhyt 0..1 MS and // Slice cho BHYT
mrn 1..1 MS // Slice cho MRN (bắt buộc)
| 識別子の種類 | 説明 |
|---|---|
| 値。値 | 特定の値によって区別される |
| パターン。パターン | パターンマッチングを使って区別する |
| タイプ | タイプによる差別化(タイプの選択) |
| プロフィール。プロフィール | プロフィールで区別する |
| 存在します | 存在によって区別される |
4. 不変条件 (FHIRPath 制約)
Invariant: vn-patient-1
Description: "Phải có ít nhất CCCD hoặc BHYT"
Expression: "identifier.where(system='http://cccd.gov.vn').exists() or identifier.where(system='http://bhxh.gov.vn/bhyt').exists()"
Severity: #error
Invariant: vn-patient-2
Description: "Nếu có CCCD thì phải có 12 chữ số"
Expression: "identifier.where(system='http://cccd.gov.vn').value.matches('^[0-9]{12}$')"
Severity: #error
5. 実装ガイド (IG)
IG は、プロファイル、拡張機能、ValueSet、CodeSystem、サンプル、説明ドキュメントなどの完全なパッケージです。
IGプロジェクトの構造
vn-core-ig/
├── sushi-config.yaml # SUSHI config
├── input/
│ ├── fsh/
│ │ ├── profiles/
│ │ │ ├── VNPatient.fsh
│ │ │ ├── VNEncounter.fsh
│ │ │ └── VNObservation.fsh
│ │ ├── extensions/
│ │ │ ├── VNEthnicity.fsh
│ │ │ └── VNAddress.fsh
│ │ ├── terminology/
│ │ │ ├── VNEthnicityCS.fsh
│ │ │ └── VNEthnicityVS.fsh
│ │ └── examples/
│ │ └── ExamplePatient.fsh
│ └── pagecontent/
│ ├── index.md
│ └── design.md
├── ig.ini
└── _genonce.sh
寿司設定.yaml
id: vn.fhir.core
canonical: http://fhir.vn/ig/core
name: VNCoreIG
title: "Vietnam Core FHIR Implementation Guide"
status: active
version: 0.1.0
fhirVersion: 5.0.0
copyrightYear: 2025+
releaseLabel: ci-build
publisher:
name: Vietnam Health IT Association
dependencies:
hl7.fhir.r5.core: 5.0.0
ビルドIG
# Install SUSHI
npm install -g fsh-sushi
# Compile FSH → FHIR JSON
sushi .
# Run IG Publisher
./_genonce.sh
# Output: output/ directory with HTML pages
6. 参考としての US Core と IPS
| IG | 説明 | プロフィール |
|---|---|---|
| 米国コア | 米国、21世紀の治療法で必須 | 患者、出会い、状態、観察、投薬、... |
| IPS | 国際患者概要、ISO 27269 | 患者、薬、アレルギー、問題、予防接種など... |
| AUベース | オーストラリア | オーストラリアの患者、オーストラリアの医師、... |
7. まとめ
プロフィール — リソース バインディング (必須要素、バインディング、カーディナリティ)
延長 — ベースにないデータを追加します (単純、複合、修飾子)
スライス — 個別の制約を使用して繰り返し要素をスライスに分割します。
不変条件 — FHIRPath を使用したビジネス ルール
FSH + 寿司 — 簡潔なプロファイル/拡張機能を記述するための DSL 言語
IGパブリッシャー — FSH/JSON から Web サイトのドキュメントを構築する