# UK FHIR Developer - Implementation Guide and Testing (FHIR Validation) **Category:** [FHIR](https://openhealthhub.org/c/fhir/31) **Created:** 2019-12-01 10:51 UTC **Views:** 2720 **Replies:** 2 **URL:** https://openhealthhub.org/t/uk-fhir-developer-implementation-guide-and-testing-fhir-validation/2154 --- ## Post #1 by @mayfield.g.kev I did a presentation this week at HL7 UK on developing with FHIR in the UK. As a developer I face a number of problems working with FHIR and the biggest one for me, is being able to **test what I've done is correct**. FHIR has a number of tools to support this but they are not simple to use in the UK. # Online FHIR Validation I've blogged about one solution before https://www.openhealthhub.org/t/validating-fhir-care-connect/2056/7 This described how to use the FHIR Validator app within the Care Connect Reference Implementation. I've worked with Aire Logic to produce a new version which uses: * NHS Digital Ontology Server to validate all coding including UK SNOMED. * Uses FHIR 3.0.2 * Includes a FHIR Bundle viewer ![24|690x356](upload://1udM02gA7pIFBybyTJcKxagfm95.png) # Command Line - Official HL7 FHIR Validation Tool A solution is to use the official HL7 Validation Tool, details can be found here on how to use the tool: [Using the FHIR Validator](https://wiki.hl7.org/Using_the_FHIR_Validator). This requires an ImplementationGuide which we don't have in the UK. ## UK Implementation Guide (example) This is not an official guide and the Profiles it contains are also not official (see next section for reasons) To work around this I've created a UK Base ImplementationGuide which can currently be found here: [UK Base Implementation Guide](https://interopen.github.io/careconnect-base-stu3/) ![40|690x360](upload://ycp7P5OrtlLrnspGWj94PtsJewt.png) I've concentrated on making it work from a technical perspective. However it does work for validating/testing resources against UK profiles. So to validate a Patient resource in a patient.xml file you can use the following command (with the HL7 FHIR Validator) > java -jar org.hl7.fhir.validator.jar c:\temp\patient.xml -version 3.0 -ig [https://interopen.github.io/careconnect-base-stu3/](https://interopen.github.io/careconnect-base-stu3/) ## Errors in Profiles As mentioned above, the Profiles are not official and contain numerous corrections to support validation. The changes include: * Removal of snapshots from the profile * Correction of typos * Removal of some ValueSets (mostly in Patient, the core spec and UK said the same thing) ## Terminology Support The official validator should also work with the [NHS Digital Ontology Server](https://ontoserver.csiro.au/) The FHIR server for this is https://ontoserver.dataproducts.nhs.uk/fhir/ In theory we can validate UK FHIR resources using both the IG and the Onto Server by using this command (At the time of writing this doesn't work correctly): > java -jar org.hl7.fhir.validator.jar c:\temp\patient.xml -version 3.0 -ig https://interopen.github.io/careconnect-base-stu3 -tx https://ontoserver.dataproducts.nhs.uk/fhir/ # Open Source All of the code above is open source and the repositories can be found on GitHub: * https://github.com/project-wildfyre/validation Aire Logic FHIR Validation App * https://github.com/nhsconnect/careconnect-reference-implementation Validation Server (Aire Logic app uses a server based on the AireLogic branch) * https://interopen.github.io/careconnect-base-stu3 UK Base Implementation Guide, the changed resources can be found in the resources folder. ## Other Conformance Resources This is more experimental at present but profiles are not enough for FHIR Implementation. IG is shown above but others such as: * GraphDefinition - rules and display of models * Questionnaire - rules on FHIR QuestionnaireResponse * ObservationDefinition - units and codes for common observations. A demonstration of these is here: https://project-wildfyre.github.io/conformance For GraphDefinition I've created a number of examples in particular for GP Connect [Structured Response](https://project-wildfyre.github.io/conformance/graph/3). Others includes [Transfer of Care FHIR Documents](https://project-wildfyre.github.io/conformance/graph/1) and [Digital Child Health Birth Details - FHIR Messaging](https://project-wildfyre.github.io/conformance/graph/2) The use of GraphDefinition, as I see it, is to explain what is in a FHIR Bundle and how the Bundle is constructed - this is not covered in FHIR profiles. A nice side effect is the GraphDefinition can be use to create a diagram. This is again open source https://github.com/project-wildfyre/conformance --- ## Post #2 by @mayfield.g.kev Note the above post has been edited as the IG has moved to HL7 UK github --- ## Post #3 by @mayfield.g.kev and moved again. Shouldn't move again....... --- **Canonical:** https://openhealthhub.org/t/uk-fhir-developer-implementation-guide-and-testing-fhir-validation/2154 **Original content:** https://openhealthhub.org/t/uk-fhir-developer-implementation-guide-and-testing-fhir-validation/2154