HEDIS Profile validations

12 views
Skip to first unread message

ananth k

unread,
Jul 23, 2025, 5:34:46 AMJul 23
to HAPI FHIR
Hello,

i was trying to validate an Encounter agains HEDIS core encounter, but not able to do 

can anyone please help with any sample code

here is my code
FhirContext ctx = FhirContext.forR4();

StructureDefinition hedisProfile = ctx.newJsonParser().parseResource(StructureDefinition.class, new FileInputStream("hedis-encounter.json"));

PrePopulatedValidationSupport support = new PrePopulatedValidationSupport(ctx);
support.addStructureDefinition(hedisProfile);
List<StructureDefinition> defaultDefinitions = new DefaultProfileValidationSupport(ctx).fetchAllStructureDefinitions();
for (StructureDefinition definition : defaultDefinitions) {
support.addStructureDefinition(definition);
}


FhirValidator validator = ctx.newValidator();
IValidatorModule module = new FhirInstanceValidator(support);
validator.registerValidatorModule(module);

// Assuming the profile is loaded into the context or directly referenced
ValidationResult result = validator.validateWithResult(hedisEncounterRecord);

James Agnew

unread,
Jul 23, 2025, 5:41:28 AMJul 23
to ananth k, HAPI FHIR
You can't use PrePopulatedValidationSupport alone, it needs to be added to a chain so that you have base definitions available, terminology services, snapshot generation, etc.

There is an example here, which uses NPM Package validation instead of PrePopulatedValidation, but the net result is the same.

Cheers,
James

--
You received this message because you are subscribed to the Google Groups "HAPI FHIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/hapi-fhir/a5f5f87b-8b64-49bd-8d96-f72c89e870b4n%40googlegroups.com.

ananth k

unread,
Aug 1, 2025, 12:34:39 AMAug 1
to HAPI FHIR
Hey James,

Is there any sample code specifically showing how to do HEDIS Implementation Guide profile validations?

Thank you
Ananthram
Reply all
Reply to author
Forward
0 new messages