FHIR © HL7.org  |  FHIRsmith 4.0.1  |  Server Home  |  XIG Home  |  XIG Stats  | 

FHIR IG analytics

Packagefhirfrog.au-core-tests
Resource TypeTestScript
IdTestScript-au-core-smokingstatus.json
FHIR VersionR4
Sourcehttps://build.fhir.org/ig/jgsuess/au-core-tests/TestScript-au-core-smokingstatus.html
URLhttp://fhirfrog.org/fhir/au-core-tests/TestScript/au-core-smokingstatus
Version0.1.0
Statusactive
Date2026-08-16T05:55:37+00:00
NameAUCoreSmokingStatus
TitleAU Core Smoking Status — SHALL-level conformance
DescriptionCovers the AU Core Smoking Status Observation (au-core-smokingstatus, 2.0.0) requirements identified in fhirfrog/au-core-compiler#24 (AUC-026): read, search by patient+code/patient+category/patient+category+date (mirroring au-fhir-core-inferno's smokingstatus group), must-support element presence across all 8 MS elements (status, category, category:socialHistory, code, subject, effective[x], value[x], dataAbsentReason), and profile conformance validation. Both category (fixed social-history) and code (fixed SNOMED 1747861000168109 'Tobacco smoking status') are pattern-constrained to a single value by the profile itself, so both fixtures share identical category/code - only value[x] vs dataAbsentReason differs between them, mirroring the profile's au-core-obs-01 condition on value[x] (value or dataAbsentReason must be present). Per issue #24's own scoping call, this profile has no obligation-extension or negative-testing complexity beyond that presence pairing - unlike fhirfrog/au-core-compiler#21/#22, no dedicated ObligationNoError/responseCode test is included here, matching the simpler pattern already established for fhirfrog/au-core-compiler#6-#20.

Resources that use this resource

No resources found


Resources that this resource uses

No resources found


Narrative

Note: links and images are rebased to the (stated) source

Generated Narrative: TestScript au-core-smokingstatus

url: TestScript AU Core Smoking Status — SHALL-level conformance

version: 0.1.0

name: AUCoreSmokingStatus

title: AU Core Smoking Status — SHALL-level conformance

status: Active

date: 2026-08-16 05:55:37+0000

publisher: FHIR Frog

contact: FHIR Frog: https://gitlab.com/fhirfrog

description:

Covers the AU Core Smoking Status Observation (au-core-smokingstatus, 2.0.0) requirements identified in fhirfrog/au-core-compiler#24 (AUC-026): read, search by patient+code/patient+category/patient+category+date (mirroring au-fhir-core-inferno's smokingstatus group), must-support element presence across all 8 MS elements (status, category, category:socialHistory, code, subject, effective[x], value[x], dataAbsentReason), and profile conformance validation. Both category (fixed social-history) and code (fixed SNOMED 1747861000168109 'Tobacco smoking status') are pattern-constrained to a single value by the profile itself, so both fixtures share identical category/code - only value[x] vs dataAbsentReason differs between them, mirroring the profile's au-core-obs-01 condition on value[x] (value or dataAbsentReason must be present). Per issue #24's own scoping call, this profile has no obligation-extension or negative-testing complexity beyond that presence pairing - unlike fhirfrog/au-core-compiler#21/#22, no dedicated ObligationNoError/responseCode test is included here, matching the simpler pattern already established for fhirfrog/au-core-compiler#6-#20.

fixture

id

patient-fixture

autocreate: true

autodelete: true

resource: au-core-patient-conformant

fixture

id

smokingstatus-fixture

autocreate: true

autodelete: true

resource: au-core-smokingstatus-conformant

fixture

id

smokingstatus-absent-fixture

autocreate: true

autodelete: true

resource: au-core-smokingstatus-absent

variable

name: patientId

path: Patient.id

sourceId: patient-fixture

variable

name: smokingStatusId

path: Observation.id

sourceId: smokingstatus-fixture

variable

name: smokingStatusAbsentId

path: Observation.id

sourceId: smokingstatus-absent-fixture

test

name: Read

action

Operations

-TypeResourceEncodeRequestUrlParams
*Test script operation code: read (Read)Observationtrue/${smokingStatusId}

action

Asserts

-ResponseWarningOnly
*okayfalse

test

name: SearchByPatientCode

action

Operations

-TypeResourceEncodeRequestUrlParams
*Test script operation code: search (Search)Observationtrue?patient=Patient/${patientId}&code=http://snomed.info/sct|1747861000168109

action

Asserts

-ResponseWarningOnly
*okayfalse

action

Asserts

-ExpressionWarningOnly
*Bundle.entry.resource.ofType(Observation).code.coding.code.where($this = '1747861000168109').exists()false

test

name: SearchByPatientCategory

action

Operations

-TypeResourceEncodeRequestUrlParams
*Test script operation code: search (Search)Observationtrue?patient=Patient/${patientId}&category=http://terminology.hl7.org/CodeSystem/observation-category|social-history

action

Asserts

-ResponseWarningOnly
*okayfalse

action

Asserts

-ExpressionWarningOnly
*Bundle.entry.resource.ofType(Observation).category.coding.code.where($this = 'social-history').exists()false

test

name: SearchByPatientCategoryDate

action

Operations

-TypeResourceEncodeRequestUrlParams
*Test script operation code: search (Search)Observationtrue?patient=Patient/${patientId}&category=http://terminology.hl7.org/CodeSystem/observation-category|social-history&date=2026-01-10

action

Asserts

-ResponseWarningOnly
*okayfalse

action

Asserts

-ExpressionWarningOnly
*Bundle.entry.resource.ofType(Observation).code.coding.code.where($this = '1747861000168109').exists()false

test

name: MustSupport

action

Operations

-TypeResourceEncodeRequestUrlParams
*Test script operation code: read (Read)Observationtrue/${smokingStatusId}

action

Asserts

-ExpressionWarningOnly
*Observation.status.exists()false

action

Asserts

-ExpressionWarningOnly
*Observation.category.exists()false

action

Asserts

-ExpressionWarningOnly
*Observation.category.coding.code.where($this = 'social-history').exists()false

action

Asserts

-ExpressionWarningOnly
*Observation.code.coding.code.where($this = '1747861000168109').exists()false

action

Asserts

-ExpressionWarningOnly
*Observation.subject.exists()false

action

Asserts

-ExpressionWarningOnly
*Observation.effective.exists()false

action

Asserts

-ExpressionWarningOnly
*Observation.value.exists()false

test

name: MustSupportAbsent

action

Operations

-TypeResourceEncodeRequestUrlParams
*Test script operation code: read (Read)Observationtrue/${smokingStatusAbsentId}

action

Asserts

-ExpressionWarningOnly
*Observation.dataAbsentReason.exists()false

test

name: ProfileValidation

action

Operations

-TypeResourceEncodeRequestUrlParams
*Test script operation code: read (Read)Observationtrue/${smokingStatusId}

action

Asserts

-ValidateProfileIdWarningOnly
*http://hl7.org.au/fhir/core/StructureDefinition/au-core-smokingstatusfalse

test

name: ProfileValidationAbsent

action

Operations

-TypeResourceEncodeRequestUrlParams
*Test script operation code: read (Read)Observationtrue/${smokingStatusAbsentId}

action

Asserts

-ValidateProfileIdWarningOnly
*http://hl7.org.au/fhir/core/StructureDefinition/au-core-smokingstatusfalse

Source1

{
  "resourceType": "TestScript",
  "id": "au-core-smokingstatus",
  "text": {
    "status": "generated",
    "div": "<!-- snip (see above) -->"
  },
  "url": "http://fhirfrog.org/fhir/au-core-tests/TestScript/au-core-smokingstatus",
  "version": "0.1.0",
  "name": "AUCoreSmokingStatus",
  "title": "AU Core Smoking Status — SHALL-level conformance",
  "status": "active",
  "date": "2026-08-16T05:55:37+00:00",
  "publisher": "FHIR Frog",
  "contact": [
    {
      "name": "FHIR Frog",
      "telecom": [
        {
          "system": "url",
          "value": "https://gitlab.com/fhirfrog"
        }
      ]
    }
  ],
  "description": "Covers the AU Core Smoking Status Observation (au-core-smokingstatus, 2.0.0) requirements identified in fhirfrog/au-core-compiler#24 (AUC-026): read, search by patient+code/patient+category/patient+category+date (mirroring au-fhir-core-inferno's smokingstatus group), must-support element presence across all 8 MS elements (status, category, category:socialHistory, code, subject, effective[x], value[x], dataAbsentReason), and profile conformance validation. Both category (fixed social-history) and code (fixed SNOMED 1747861000168109 'Tobacco smoking status') are pattern-constrained to a single value by the profile itself, so both fixtures share identical category/code - only value[x] vs dataAbsentReason differs between them, mirroring the profile's au-core-obs-01 condition on value[x] (value or dataAbsentReason must be present). Per issue #24's own scoping call, this profile has no obligation-extension or negative-testing complexity beyond that presence pairing - unlike fhirfrog/au-core-compiler#21/#22, no dedicated ObligationNoError/responseCode test is included here, matching the simpler pattern already established for fhirfrog/au-core-compiler#6-#20.",
  "fixture": [
    {
      "id": "patient-fixture",
      "autocreate": true,
      "autodelete": true,
      "resource": {
        "reference": "au-core-patient-conformant"
      }
    },
    {
      "id": "smokingstatus-fixture",
      "autocreate": true,
      "autodelete": true,
      "resource": {
        "reference": "au-core-smokingstatus-conformant"
      }
    },
    {
      "id": "smokingstatus-absent-fixture",
      "autocreate": true,
      "autodelete": true,
      "resource": {
        "reference": "au-core-smokingstatus-absent"
      }
    }
  ],
  "variable": [
    {
      "name": "patientId",
      "path": "Patient.id",
      "sourceId": "patient-fixture"
    },
    {
      "name": "smokingStatusId",
      "path": "Observation.id",
      "sourceId": "smokingstatus-fixture"
    },
    {
      "name": "smokingStatusAbsentId",
      "path": "Observation.id",
      "sourceId": "smokingstatus-absent-fixture"
    }
  ],
  "test": [
    {
      "name": "Read",
      "action": [
        {
          "operation": {
            "type": {
              "system": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes",
              "code": "read"
            },
            "resource": "Observation",
            "encodeRequestUrl": true,
            "params": "/${smokingStatusId}"
          }
        },
        {
          "assert": {
            "response": "okay",
            "warningOnly": false
          }
        }
      ]
    },
    {
      "name": "SearchByPatientCode",
      "action": [
        {
          "operation": {
            "type": {
              "system": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes",
              "code": "search"
            },
            "resource": "Observation",
            "encodeRequestUrl": true,
            "params": "?patient=Patient/${patientId}&code=http://snomed.info/sct|1747861000168109"
          }
        },
        {
          "assert": {
            "response": "okay",
            "warningOnly": false
          }
        },
        {
          "assert": {
            "expression": "Bundle.entry.resource.ofType(Observation).code.coding.code.where($this = '1747861000168109').exists()",
            "warningOnly": false
          }
        }
      ]
    },
    {
      "name": "SearchByPatientCategory",
      "action": [
        {
          "operation": {
            "type": {
              "system": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes",
              "code": "search"
            },
            "resource": "Observation",
            "encodeRequestUrl": true,
            "params": "?patient=Patient/${patientId}&category=http://terminology.hl7.org/CodeSystem/observation-category|social-history"
          }
        },
        {
          "assert": {
            "response": "okay",
            "warningOnly": false
          }
        },
        {
          "assert": {
            "expression": "Bundle.entry.resource.ofType(Observation).category.coding.code.where($this = 'social-history').exists()",
            "warningOnly": false
          }
        }
      ]
    },
    {
      "name": "SearchByPatientCategoryDate",
      "action": [
        {
          "operation": {
            "type": {
              "system": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes",
              "code": "search"
            },
            "resource": "Observation",
            "encodeRequestUrl": true,
            "params": "?patient=Patient/${patientId}&category=http://terminology.hl7.org/CodeSystem/observation-category|social-history&date=2026-01-10"
          }
        },
        {
          "assert": {
            "response": "okay",
            "warningOnly": false
          }
        },
        {
          "assert": {
            "expression": "Bundle.entry.resource.ofType(Observation).code.coding.code.where($this = '1747861000168109').exists()",
            "warningOnly": false
          }
        }
      ]
    },
    {
      "name": "MustSupport",
      "action": [
        {
          "operation": {
            "type": {
              "system": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes",
              "code": "read"
            },
            "resource": "Observation",
            "encodeRequestUrl": true,
            "params": "/${smokingStatusId}"
          }
        },
        {
          "assert": {
            "expression": "Observation.status.exists()",
            "warningOnly": false
          }
        },
        {
          "assert": {
            "expression": "Observation.category.exists()",
            "warningOnly": false
          }
        },
        {
          "assert": {
            "expression": "Observation.category.coding.code.where($this = 'social-history').exists()",
            "warningOnly": false
          }
        },
        {
          "assert": {
            "expression": "Observation.code.coding.code.where($this = '1747861000168109').exists()",
            "warningOnly": false
          }
        },
        {
          "assert": {
            "expression": "Observation.subject.exists()",
            "warningOnly": false
          }
        },
        {
          "assert": {
            "expression": "Observation.effective.exists()",
            "warningOnly": false
          }
        },
        {
          "assert": {
            "expression": "Observation.value.exists()",
            "warningOnly": false
          }
        }
      ]
    },
    {
      "name": "MustSupportAbsent",
      "action": [
        {
          "operation": {
            "type": {
              "system": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes",
              "code": "read"
            },
            "resource": "Observation",
            "encodeRequestUrl": true,
            "params": "/${smokingStatusAbsentId}"
          }
        },
        {
          "assert": {
            "expression": "Observation.dataAbsentReason.exists()",
            "warningOnly": false
          }
        }
      ]
    },
    {
      "name": "ProfileValidation",
      "action": [
        {
          "operation": {
            "type": {
              "system": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes",
              "code": "read"
            },
            "resource": "Observation",
            "encodeRequestUrl": true,
            "params": "/${smokingStatusId}"
          }
        },
        {
          "assert": {
            "validateProfileId": "http://hl7.org.au/fhir/core/StructureDefinition/au-core-smokingstatus",
            "warningOnly": false
          }
        }
      ]
    },
    {
      "name": "ProfileValidationAbsent",
      "action": [
        {
          "operation": {
            "type": {
              "system": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes",
              "code": "read"
            },
            "resource": "Observation",
            "encodeRequestUrl": true,
            "params": "/${smokingStatusAbsentId}"
          }
        },
        {
          "assert": {
            "validateProfileId": "http://hl7.org.au/fhir/core/StructureDefinition/au-core-smokingstatus",
            "warningOnly": false
          }
        }
      ]
    }
  ]
}