Skip to content

TW Core Conformance

Shinren Pan edited this page Jun 12, 2026 · 1 revision

TW Core Conformance

Siming supports TW Core IG v1.0.0 — Taiwan's MOHW FHIR Implementation Guide.

Conformance Results

Validated using the HL7 FHIR Validator service (inferno-resource-validator:1.0.78) against TW Core v1.0.0 StructureDefinitions.

Profile Result Notes
Patient-twcore ✅ PASS
Condition-twcore ✅ PASS
Encounter-twcore ✅ PASS
MedicationRequest-twcore ✅ PASS NHI CodeSystem not publicly resolvable (expected)
AllergyIntolerance-twcore ✅ PASS
Observation-laboratoryResult-twcore ✅ PASS
Practitioner-twcore ✅ PASS
Organization-twcore ✅ PASS
DiagnosticReport-twcore ✅ PASS

All results: zero ERRORs. Warnings are FHIR best-practice advisories (dom-6 narrative), not TW Core requirements.

Full report: docs/tw-core-conformance.md

Using $validate

POST /{ResourceType}/$validate validates a resource without storing it. Returns an OperationOutcome.

Terminology-only (always available)

Checks required binding codes against local ValueSet index. No external service needed.

curl -X POST http://localhost:8080/Patient/$validate \
  -H "Content-Type: application/fhir+json" \
  -d '{"resourceType":"Patient","gender":"invalid-code"}'

TW Core profile validation (requires validator sidecar)

Pass ?profile= to validate against a specific TW Core StructureDefinition.

curl -X POST "http://localhost:8080/Patient/\$validate?profile=https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/Patient-twcore" \
  -H "Content-Type: application/fhir+json" \
  -d '{
    "resourceType": "Patient",
    "identifier": [{"system": "http://www.boma.mohw.gov.tw", "value": "A123456789"}],
    "gender": "male",
    "birthDate": "1990-01-01"
  }'

Enable the validator sidecar

  1. Uncomment the validator service in docker-compose.yml
  2. Add to .env:
    VALIDATOR_URL=http://validator:4567
    
  3. Restart: docker compose up -d

First validation loads TW Core IG (~10s). Subsequent calls reuse the session (~13ms).

TW Core Required Fields

Fields required by TW Core StructureDefinitions (missing → ERROR in $validate):

Profile Required beyond FHIR R4 base
Patient identifier (min=1), gender (min=1), birthDate (min=1)
Condition clinicalStatus (min=1), category (min=1), subject (min=1)
Encounter status (min=1), class (min=1)
MedicationRequest status, intent, medication[x], subject (all min=1)
AllergyIntolerance code (min=1), patient (min=1)
Observation (lab) status, category, code, subject (all min=1)
Practitioner (no additional required fields)
Organization (no additional required fields)
DiagnosticReport status, code, subject (all min=1)

TW Core Profile URLs

Resource Profile URL
Patient https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/Patient-twcore
Condition https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/Condition-twcore
Encounter https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/Encounter-twcore
MedicationRequest https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/MedicationRequest-twcore
AllergyIntolerance https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/AllergyIntolerance-twcore
Observation (lab) https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/Observation-laboratoryResult-twcore
Practitioner https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/Practitioner-twcore
Organization https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/Organization-twcore
DiagnosticReport https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/DiagnosticReport-twcore

Clone this wiki locally