Validation with packages

Packages are very helpful in the validation of FHIR resources: just provide the validator with a package to set the right validation context. The validator should do the rest.

This exercise will demonstrate how to use packages for validation with the use of the .NET FHIR validator that is implemented in Simplifier. Other validators exist as well, such as the Java FHIR validator provided by HL7. The FHIR specification provides more information about validation in FHIR and the HL7 Java FHIR validator.

Prerequisites
  • A free Simpifier.net account (sign up here)
  • Logged into your account on Simplifier.net

1. Validate an instance against a package version

Simplifier.net's validator allows scoping the validation to a specific package or a Simplifier project. ACME has published the following acme.product.r4 1.0.0 package that will be used in this exercise.

{
    "resourceType": "Observation",
    "id": "acme-product-observation-VALID",
    "meta": {
        "versionId": "1189",
        "lastUpdated": "2016-03-09T15:29:58.419+00:00",
        "profile":  [
            "https://fake-acme.org/fhir/StructureDefinition/ACME-product-observation-lab"
        ]
    },
    "status": "final",
    "category":  [
        {
            "coding":  [
                {
                    "system": "http://terminology.hl7.org/CodeSystem/observation-category",
                    "code": "laboratory",
                    "display": "Laboratory"
                }
            ],
            "text": "Laboratory"
        }
    ],
    "code": {
        "coding":  [
            {
                "system": "http://loinc.org",
                "code": "789-8",
                "display": "RBC # Bld Auto"
            }
        ],
        "text": "RBC # Bld Auto"
    },
    "subject": {
        "reference": "Patient/example",
        "display": "Amy Shaw"
    },
    "effectiveDateTime": "2005-07-05",
    "valueQuantity": {
        "value": 4.58,
        "unit": "10*6/uL",
        "system": "http://unitsofmeasure.org"
    },
    "referenceRange":  [
        {
            "low": {
                "value": 4.1,
                "unit": "10*6/uL",
                "system": "http://unitsofmeasure.org",
                "code": "10*6/uL"
            },
            "high": {
                "value": 6.1,
                "unit": "10*6/uL",
                "system": "http://unitsofmeasure.org",
                "code": "10*6/uL"
            },
            "appliesTo":  [
                {
                    "coding":  [
                        {
                            "system": "http://terminology.hl7.org/CodeSystem/referencerange-meaning",
                            "code": "normal",
                            "display": "Normal Range"
                        }
                    ],
                    "text": "Normal Range"
                }
            ]
        }
    ]
}

 

  • Make sure R4 is selected
  • Click on the green select button within Scope
  • Search for acme.product.r4, click “show all version” and select version 1.0.0
  • Hit the validate button

2020-06-05 12_42_35-SIMPLIFIER.NET  

Validation should be successful!

2. Validate against a newer version of the package

After the first round of validation and testing, it turned out that the product profiles were not sufficiently profiled. Required elements were not profiled and many observation elements cannot be used in the ACME product use cases.

Therefore, ACME published a new version of their profiles in acme.product.r4 3.0.0 In this version, the ACME-product-observation-lab requires an ACME identifier, effective[x] value[x], device and referencRange. All unneeded elements are set to 0..0.

What are the validation results?

3. Bonus exercise