Instructions
Development
Run a Local Server
In order to develop the implementation guide, do the following steps:
- Clone the repository https://github.com/HealthSamurai/ig-ae
git clone https://github.com/HealthSamurai/ig-ae.git
- browse to the ig-ae folder
cd ig-ae
- Install modules
npm install
- Init submodules
git submodule init
- Update submodules
git submodule update
- Run a local server on the 8891 port (or specify another port if needed)
./igpop.sh dev -p 8891
- Navigate to the http://localhost:8891 to see results of editing
Console output:
$ ./igpop.sh dev -p 8891
Dev... (dev -p 8891)
Run server on http://localhost: 8891
Project Structure and Configuration
- Update the ig.yaml file in the project root folder:
id:
prefix for your FHIR resources
title:
title displayed on the home page of your IG site
url:
base URL for your profiles (StructureDefinition.url and fixedUri)
description:
your IG general description
fhir:
FHIR version (current value is 4.0.0)
- You will need to stop and start server to apply ig.yaml changes
Edit Profiles and ValueSets
When you are running profiles locally, you can edit them directly on the site:
Generate Structure Definitions
- Click the Package link to generate a package of FHIR StructureDefinitions and ValueSets
- The package will be downloaded as a zip-archive
- Unzip the archive
- Browse the folder
- The folder will contain FHIR StructureDefinitions and ValueSets
Validate Generated Structure Definitions
- Having that you downloaded and unzipped the archive with generated structure definitions, you can validate them against the base FHIR specification and your IG.
- Download the official FHIR validator — a Java jar file that can be used to validate resources (download page). (See the Validator documentation)
- Say, you've extracted files to the
adverse-event-profile
folder. Then, you will run the following command from the parent folder. - Remove the package.json file from the
adverse-event-profile
folder - Run the validator:
java -jar validator_cli.jar -version 4.0.1 adverse-event-profile/* -ig adverse-event-profile/ -recurse
See more Using the FHIR Validator.
Validate Resources against AZ Profiles
Validate against an IG as a FHIR Package .tgz file's URL
- You can specify an IG .tgz file to validate against in the command:
java -jar validator_cli.jar -version 4.0.1 path/to/resource -ig https://github.com/HealthSamurai/ig-ae/raw/master/package/az-ig-package.tgz -profile profile/StructureDefinition/url
- Example 1:
java -jar validator_cli.jar -version 4.0.1 resourcesToValidate/adverseEventSample.json -ig https://github.com/HealthSamurai/ig-ae/raw/master/package/az-ig-package.tgz -profile https://healthsamurai.github.io/ig-ae/StructureDefinition/astrazeneca.fhir.ig.ae-AdverseEvent
- Example 2:
java -jar validator_cli.jar -version 4.0.1 "docs/for review/fixed/New Adverse Event FHIR payload.json" -ig https://github.com/HealthSamurai/ig-ae/raw/master/package/az-ig-package.tgz -profile https://healthsamurai.github.io/ig-ae/StructureDefinition/astrazeneca.fhir.ig.ae-AdverseEvent
- Example 3 (fast):
java -jar validator_cli.jar -version 4.0.1 "docs/for review/fixed/New Adverse Event FHIR payload.json" -tx n/a
- Example 4:
java -jar validator_cli.jar -version 4.0.1 "docs/for review/fixed/New Adverse Event FHIR payload.json" -ig https://github.com/HealthSamurai/ig-ae/raw/master/package/az-ig-package.tgz -tx n/a
Validate against an IG as a FHIR Package .tgz local file
- You can specify an IG .tgz local file to validate against in the command:
java -jar validator_cli.jar -version 4.0.1 path/to/resource.json -ig D:/path/to/az-ig-package.tgz -profile profile/canonical/url
- Example:
java -jar validator_cli.jar -version 4.0.1 resourcesToValidate/adverseEventSample.json -ig D:/Work/Healthsamurai/az-fhir-profiles/az-ig-package.tgz -profile https://healthsamurai.github.io/ig-ae/StructureDefinition/astrazeneca.fhir.ig.ae-AdverseEvent
Validate against an IG as a local folder
- You can download an IG files and validate resources against it with the
recurse
parameter:
java -jar validator_cli.jar -version 4.0.1 path/to/resource -ig path/to/ig/folder/ -recurse -profile profile/canonical/url
- Example:
java -jar validator_cli.jar -version 4.0.1 resourcesToValidate/adverseEventSample.json -ig adverse-event-profile/ -recurse -profile https://healthsamurai.github.io/ig-ae/StructureDefinition/astrazeneca.fhir.ig.ae-AdverseEvent
Validate a resource with meta element
- You can specify profiles to validate against in the resource's
meta
element:
"meta": {
"profile": ["https://healthsamurai.github.io/ig-ae/StructureDefinition/astrazeneca.fhir.ig.ae-AdverseEvent"]
}
- Then, you can run the following command without specifying the
profile
parameter:
java -jar validator_cli.jar -version 4.0.1 path/to/resource -ig https://github.com/HealthSamurai/ig-ae/raw/master/package/az-ig-package.tgz
- Example:
java -jar validator_cli.jar -version 4.0.1 resourcesToValidate/adverseEventSample.json -ig https://github.com/HealthSamurai/ig-ae/raw/master/package/az-ig-package.tgz
Validation without a terminology server
- Sometimes a terminology server is unavailable. You can set the following parameter to validate without a terminology server.
-tx n/a
- Example:
java -jar validator_cli.jar -version 4.0.1 resourcesToValidate/adverseEventSample.json -ig https://github.com/HealthSamurai/ig-ae/raw/master/package/az-ig-package.tgz -profile https://healthsamurai.github.io/ig-ae/StructureDefinition/astrazeneca.fhir.ig.ae-AdverseEvent -tx n/a
Validate against a FHIR Package published to FHIR Registry
java -jar validator_cli.jar -version 4.0.1 resourcesToValidate/adverseEventSample.json -ig hl7.fhir.us.patient-reported-outcomes
Validate against an IG files by their URLs
java -jar validator_cli.jar -version 4.0.1 resourcesToValidate/adverseEventSample.json -profile https://healthsamurai.github.io/ig-ae/StructureDefinition/astrazeneca.fhir.ig.ae-AdverseEvent -ig https://healthsamurai.github.io/ig-ae/StructureDefinition/astrazeneca.fhir.ig.ae-AdverseEvent.json -ig https://healthsamurai.github.io/ig-ae/StructureDefinition/astrazeneca.fhir.ig.ae-AdverseEvent-AZEmployeeReporter.json -ig https://healthsamurai.github.io/ig-ae/StructureDefinition/astrazeneca.fhir.ig.ae-AdverseEvent-lateReason.json -ig https://healthsamurai.github.io/ig-ae/StructureDefinition/astrazeneca.fhir.ig.ae-AdverseEvent-localReference.json -ig https://healthsamurai.github.io/ig-ae/StructureDefinition/astrazeneca.fhir.ig.ae-AdverseEvent-positiveDechallenge.json -ig https://healthsamurai.github.io/ig-ae/StructureDefinition/astrazeneca.fhir.ig.ae-AdverseEvent-positiveRechallenge.json -ig https://healthsamurai.github.io/ig-ae/StructureDefinition/astrazeneca.fhir.ig.ae-AdverseEvent-programNumber.json -ig https://healthsamurai.github.io/ig-ae/StructureDefinition/astrazeneca.fhir.ig.ae-AdverseEvent-rechallenge.json -ig https://healthsamurai.github.io/ig-ae/StructureDefinition/astrazeneca.fhir.ig.ae-AdverseEvent-reporterType.json -ig https://healthsamurai.github.io/ig-ae/StructureDefinition/astrazeneca.fhir.ig.ae-AdverseEvent-sourceType.json -ig https://healthsamurai.github.io/ig-ae/StructureDefinition/astrazeneca.fhir.ig.ae-AdverseEvent-surveyStatus.json -ig https://healthsamurai.github.io/ig-ae/ValueSet/astrazeneca.fhir.ig.ae-survey-status.json -ig https://healthsamurai.github.io/ig-ae/ValueSet/astrazeneca.fhir.ig.ae-intelligent-source.json
Validating a single resource in a bundle
To validate a particular resource in the bundle against a given profile:
-bundle {entry rule} {profile url}
This invokes the nominated profile (by canonical URL) on any entry in any bundle validated that meets the entry rule. The entry rule is either a Resource name, a integer index, or both:
- Patient - validate any patient against the nominated profile
- 1 - validate the 1th resource (actually the second - index is 0 based) against the nominated profile
- Patient:0 - validate the first patient resource against the nominated profile
Example:
java -jar validator_cli.jar path/to/bundle.json -version 4.0.1 -ig https://github.com/HealthSamurai/ig-ae/raw/master/package/az-ig-package.tgz -bundle Patient:0 https://healthsamurai.github.io/ig-ae/StructureDefinition/astrazeneca.fhir.ig.ae-AdverseEvent
Create new profile
See the IGPOP spec.