1. 検索パラメータの種類
| 種類 | 説明 | たとえば |
|---|---|---|
| 文字列.文字列 | テキストを検索する | 患者?名前=グエン |
| トークン | コード/識別子 | 患者?性別=男性 |
| 参考。参照 | 別のリソースへの参照 | 観察?被験者=患者/123 |
| 日付。日付 | 日付 | 患者?生年月日=1990-05-15 |
| 番号。番号 | いいえ | リスク評価?確率=gt0.8 |
| 量。量 | 数値+単位 | 観察?値-量=gt5.4|http://unitsofmeasure.org|mg |
| ウリ | URI | 値セット?url=http://hl7.org/fhir/ValueSet/example |
| 複合材 | 複数のパラメータを結合する | 観測?コード値数量=... |
| 特別な | 特に | 位置?近く=42.2|-71.0|10|km |
2. 文字列検索
# Default: starts-with, case-insensitive
GET /Patient?name=Nguyen
# Exact match
GET /Patient?name:exact=Nguyễn
# Contains
GET /Patient?name:contains=van
# Text (full-text search trên narrative)
GET /Patient?_text=hypertension
3. トークンの検索
# Chỉ code
GET /Patient?gender=male
# System + code
GET /Condition?code=http://hl7.org/fhir/sid/icd-10|I10
# Chỉ system (tìm tất cả codes trong system)
GET /Condition?code=http://snomed.info/sct|
# Identifier
GET /Patient?identifier=http://hospital.vn/mrn|MRN12345
# :not modifier
GET /Patient?gender:not=male
# :text modifier (tìm trên display text)
GET /Condition?code:text=hypertension
4. 日付検索
# Exact date
GET /Patient?birthdate=1990-05-15
# Prefixes: eq, ne, gt, lt, ge, le, sa (starts after), eb (ends before)
GET /Patient?birthdate=gt1990-01-01
GET /Encounter?date=ge2025-01-01&date=le2025-01-31
GET /Observation?date=sa2025-01-01T00:00:00Z
# Precision matters
GET /Patient?birthdate=1990 # born in 1990
GET /Patient?birthdate=1990-05 # born in May 1990
5. 文献検索
# Relative reference
GET /Observation?subject=Patient/patient-001
# Chỉ ID (nếu type rõ ràng)
GET /Observation?subject=patient-001
# Absolute reference
GET /Observation?subject=https://fhir-server.example.com/fhir/r5/Patient/patient-001
# Identifier trên referenced resource
GET /Observation?subject:identifier=http://hospital.vn/mrn|MRN12345
6. 連鎖 — 参考文献を検索する
# Tìm Observation của Patient có tên "Nguyen"
GET /Observation?subject:Patient.name=Nguyen
# Chain sâu hơn
GET /Observation?subject:Patient.organization.name=Bach%20Mai
# Tìm MedicationRequest kê bởi Practitioner chuyên khoa Tim mạch
GET /MedicationRequest?requester:Practitioner.qualification=cardiology
7. リバースチェーン (_has)
# Tìm Patient có Observation với code=hba1c và value>7
GET /Patient?_has:Observation:subject:code=4548-4&_has:Observation:subject:value-quantity=gt7
# Tìm Patient có Condition "hypertension" active
GET /Patient?_has:Condition:subject:code=I10&_has:Condition:subject:clinical-status=active
# Tìm Practitioner có ít nhất 1 Encounter
GET /Practitioner?_has:Encounter:participant:date=ge2025-01-01
8. _include と _revinclude
# _include: kéo theo referenced resources
# Tìm Encounter VÀ Patient của Encounter đó
GET /Encounter?date=ge2025-01-15&_include=Encounter:subject
# Multiple includes
GET /MedicationRequest?status=active
&_include=MedicationRequest:subject
&_include=MedicationRequest:requester
&_include=MedicationRequest:medication
# _revinclude: kéo theo resources reference ngược lại
# Tìm Patient VÀ tất cả Observation, Condition reference đến Patient
GET /Patient?_id=patient-001
&_revinclude=Observation:subject
&_revinclude=Condition:subject
# :iterate — recursive include
GET /MedicationRequest?_include:iterate=MedicationRequest:medication
9. 結果パラメータ
# _count — số entry per page
GET /Patient?name=Nguyen&_count=20
# _sort — sắp xếp
GET /Observation?subject=Patient/patient-001&_sort=-date # descending
GET /Patient?_sort=family,given # multi-sort
# _summary — trả về tóm tắt
GET /Patient?_summary=true # chỉ `mandatory` elements
GET /Patient?_summary=count # chỉ count, không trả resources
GET /Patient?_summary=text # text + id + meta + mandatory
# _elements — chọn elements cụ thể
GET /Patient?_elements=name,birthDate,gender,identifier
# _total — kiểm soát tính total
GET /Patient?_total=accurate # tính chính xác total
GET /Patient?_total=none # không tính total (nhanh hơn)
10. ページング
{
"resourceType": "Bundle",
"type": "searchset",
"total": 150,
"link": [
{"relation": "self", "url": "...?_count=10&_offset=0"},
{"relation": "first", "url": "...?_count=10&_offset=0"},
{"relation": "next", "url": "...?_count=10&_offset=10"},
{"relation": "last", "url": "...?_count=10&_offset=140"}
]
}
クライアントはリンクをたどります 次に。次へ 次のページを取得します。 独自の URL を作成しないでください — 常にサーバー応答からのリンクを使用します。
11. カスタム検索パラメータ
{
"resourceType": "SearchParameter",
"url": "http://hospital.vn/fhir/SearchParameter/patient-cccd",
"name": "cccd",
"status": "active",
"description": "Tìm Patient theo số CCCD",
"code": "cccd",
"base": ["Patient"],
"type": "token",
"expression": "Patient.identifier.where(system='http://hospital.vn/cccd')"
}
# Sử dụng custom search parameter
GET /Patient?cccd=012345678901
12. まとめ
9種類のパラメータ — 文字列、トークン、参照、日付、数値、数量、URI、複合、特殊
修飾子 — :exact、:contains、:missing、:not、:text、:identifier
連鎖 — チェーン参照の検索 (件名:Patient.name)
_あります — 逆連鎖、他のリソースによって参照されているリソースの検索
_include / _revinclude — 参照リソースを結果にドラッグします
_summary、_elements、_sort、_count — 制御応答性