FHIR Chat · HAPI FHIR custom profile validation issue · hapi

Stream: hapi

Topic: HAPI FHIR custom profile validation issue


view this post on Zulip Aditya (May 06 2019 at 13:47):

I have custom profile for AllergyIntolerance that forge generated as below :

custom.xml

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 ?

view this post on Zulip Aditya (May 06 2019 at 20:05):

I have custom profile for AllergyIntolerance that forge generated as below :

custom.xml

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 ?

I found out that Forge generates some <text></text> field at start which needs to be removed


Last updated: Apr 12 2022 at 19:14 UTC