Stream: implementers
Topic: Forge Custom profile validation using FHIR HAPI
Aditya (May 06 2019 at 14:06):
I have custom profile for AllergyIntolerance that forge generated as below :
I have validation code as below :
List<StructureDefinition> definitions = new ArrayList<>(); /* * code extracts definitions from custom.xml file attaches and loads into "definitions" list */ IValidationSupport valSupport = new MyValidationSupport(definitions); ValidationSupportChain support = new ValidationSupportChain(valSupport); FhirValidator validator = ctx.newValidator(); FhirInstanceValidator instanceValidator = new FhirInstanceValidator(); instanceValidator.setValidationSupport(support); validator.registerValidatorModule(instanceValidator);
The AllergyIntolerance input supplied to be validated is as below :
AllergyIntolerance.txt
The output is as below :
{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "information",
"code": "informational",
"diagnostics": "No issues detected during validation"
}
]
}
If you see thee input, verificationStatus is missing and the custom profile lists it as mandatory :
-element id="AllergyIntolerance.verificationStatus"
-path value="AllergyIntolerance.verificationStatus"
-mustSupport value="true"
-isModifier value="false"
-mapping
-identity value="argonaut-dq-dstu2"
-map value="AllergyIntolerance.status"
-mapping
-element
So I need to figure out why is the validation succeeding even if verificationStatus is missing in i/p and is required in forge generated custom profile.
Am I missing something here ?
Last updated: Apr 12 2022 at 19:14 UTC