Skip to content

AU Core Examples

FHIR Frog includes comprehensive test coverage for AU Core profiles, demonstrating real-world usage with Australian FHIR identifiers.

Overview

AU Core is the Australian national FHIR Implementation Guide. These examples show how to test AU Core profiles with FHIR Frog.

What's Tested

  • 4 Resource Types: Patient, Practitioner, Organization, Observation
  • 6 Australian Identifiers: Medicare, IHI, HPI-I, AHPRA, HPI-O, ABN
  • 7 Test Scenarios: CRUD, search, negative tests, advanced patterns

Test Results

Tests run: 7, Failures: 0, Errors: 0, Skipped: 0
Time elapsed: 34.4 seconds
BUILD SUCCESS

Setup

1. Build AU Core Image

AU Core IG takes 10-15 minutes to load. Build a Docker image once:

./build-au-core-image.sh

This creates hapi-fhir-au-core:1.0.0 with AU Core pre-loaded.

2. Run Tests

cd fhir-frog-sample
mvn test -Dtest=AUCoreSuiteIT

Tests start in ~30 seconds using the pre-built image.

Test Architecture

Diagram

Australian Identifiers

Patient Identifiers

Medicare Number

{
  "system": "http://ns.electronichealth.net.au/id/medicare-number",
  "value": "6951449304"
}

IHI (Individual Healthcare Identifier)

{
  "system": "http://ns.electronichealth.net.au/id/hi/ihi/1.0",
  "value": "8003608000228437"
}

Practitioner Identifiers

HPI-I (Healthcare Provider Identifier - Individual)

{
  "system": "http://ns.electronichealth.net.au/id/hi/hpii/1.0",
  "value": "8003610000000000"
}

AHPRA (Australian Health Practitioner Regulation Agency)

{
  "system": "http://hl7.org.au/id/ahpra-registration-number",
  "value": "MED0000932945"
}

Organization Identifiers

HPI-O (Healthcare Provider Identifier - Organisation)

{
  "system": "http://ns.electronichealth.net.au/id/hi/hpio/1.0",
  "value": "8003620000000000"
}

ABN (Australian Business Number)

{
  "system": "http://hl7.org.au/id/abn",
  "value": "51824753556"
}

Test Scenarios

1. Patient CRUD

Tests creating, reading, and deleting an AU Core Patient:

@TestTemplate
@TestScriptSource("fhir/au-core-patient-crud.json")
void testPatient() {
}

What it tests: - ✅ Create Patient with Medicare number and IHI - ✅ Read Patient by ID - ✅ Search for Patients - ✅ Delete Patient

2. Patient Search by Identifiers

Tests AU-specific search parameters:

@TestTemplate
@TestScriptSource("fhir/au-core-patient-search-identifiers.json")
void testPatientSearchByIdentifiers() {
}

What it tests: - ✅ Search by Medicare number - ✅ Search by IHI - ✅ Search by family name

3. Practitioner CRUD

Tests AU Core Practitioner with HPI-I and AHPRA:

@TestTemplate
@TestScriptSource("fhir/au-core-practitioner-crud.json")
void testPractitioner() {
}

4. Organization CRUD

Tests AU Core Organization with HPI-O and ABN:

@TestTemplate
@TestScriptSource("fhir/au-core-organization-crud.json")
void testOrganization() {
}

5. Observation with Transaction Bundle

Tests creating related resources atomically:

@TestTemplate
@TestScriptSource("fhir/au-core-observation-crud.json")
void testObservation() {
}

Uses transaction bundle to create Patient and Observation together.

6. Negative Testing

Tests error handling:

@TestTemplate
@TestScriptSource("fhir/au-core-patient-negative.json")
void testNegativeCases() {
}

What it tests: - ✅ Invalid Medicare number format (400/422) - ✅ Non-existent resource (404)

Tests complex search patterns:

@TestTemplate
@TestScriptSource("fhir/au-core-advanced-search.json")
void testAdvancedSearch() {
}

What it tests: - ✅ Date range queries (ge, le) - ✅ _include parameters - ✅ Multiple search parameters

Performance

Test Time Operations
Patient CRUD ~10s Create, Read, Search, Delete
Patient Search ~12s 3 identifier searches
Practitioner CRUD ~9s Create, Read, Search, Delete
Organization CRUD ~9s Create, Read, Search, Delete
Observation ~8s Transaction bundle, Search
Negative Tests ~5s 2 error scenarios
Advanced Search ~7s 3 search patterns
Total 34.4s 7 test scenarios

Files

Test Classes

  • AUCoreSuiteIT.java - Comprehensive test suite
  • AUCorePatientIT.java - Patient-specific tests
  • BasicPatientIT.java - Standard FHIR tests

TestScripts

  • au-core-patient-crud.json
  • au-core-patient-search-identifiers.json
  • au-core-practitioner-crud.json
  • au-core-organization-crud.json
  • au-core-observation-crud.json
  • au-core-patient-negative.json
  • au-core-advanced-search.json

Fixtures

  • au-core-patient-example.json
  • au-core-practitioner-example.json
  • au-core-organization-example.json
  • observation-bundle.json
  • invalid-patient-example.json

Key Patterns

{
  "resourceType": "Bundle",
  "type": "transaction",
  "entry": [
    {
      "fullUrl": "urn:uuid:patient-1",
      "resource": { /* Patient */ },
      "request": {"method": "POST", "url": "Patient"}
    },
    {
      "resource": {
        /* Observation referencing urn:uuid:patient-1 */
      },
      "request": {"method": "POST", "url": "Observation"}
    }
  ]
}

Variable Extraction

{
  "variable": [{
    "name": "patientId",
    "expression": "Patient.id",
    "sourceId": "create-response"
  }]
}

Identifier Searches

{
  "operation": {
    "type": {"code": "search"},
    "resource": "Patient",
    "params": "?identifier=http://ns.electronichealth.net.au/id/medicare-number|6951449304"
  }
}

References