Stream: implementers
Topic: Unable to find code system and profile us-core-observationre
Aditya (May 15 2019 at 14:16):
I am using custom validator (MyValidationSupport implements IValidationSupport) chained with DefaultValidationSupport. I am getting following error & warning while validating DiagnosticReport.
"issue": [
{
"severity": "warning",
"code": "processing",
"diagnostics": "Error unable to find code system http://loinc.org validating CodeableConcept",
"location": [
"DiagnosticReport.code"
]
},
{
"severity": "error",
"code": "processing",
"diagnostics": "Unable to resolve the profile reference 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-observationresults'",
"location": [
"DiagnosticReport.result[1]"
]
}
What am i missing ?
I am able to successfully validate AllergyIntolerance which means it is able to find profile http://hl7.org/fhir/us/core/StructureDefinition/us-core-allergyintolerance
Lloyd McKenzie (May 15 2019 at 14:24):
Does the standard validator work? (That might hint as to whether the issue is in the instances/IG somehow vs. the customized code.)
Aditya (May 15 2019 at 14:25):
Does the standard validator work? (That might hint as to whether the issue is in the instances/IG somehow vs. the customized code.)
It does and also the forge custom profiles work
Lloyd McKenzie (May 15 2019 at 14:27):
If the problem is with your customized code, it's going to be hard for the community to help much :(
Aditya (May 15 2019 at 14:30):
If the problem is with your customized code, it's going to be hard for the community to help much :(
I am not sure if it is though, because rest all profiles are working great. Below is the custom Validator just in case if there is any obvious flaw
package com.ecw.fhir.validator;
import java.util.HashMap;
import java.util.List;
import org.hl7.fhir.dstu3.hapi.ctx.IValidationSupport;
import org.hl7.fhir.dstu3.model.CodeSystem;
import org.hl7.fhir.dstu3.model.StructureDefinition;
import org.hl7.fhir.dstu3.model.ValueSet;
import org.hl7.fhir.instance.model.api.IBaseResource;
import ca.uhn.fhir.context.FhirContext;
public class MyValidationSupport implements IValidationSupport {
HashMap<String, StructureDefinition> definitionsMap = null;
List<StructureDefinition> definitions = null;
public MyValidationSupport(List<StructureDefinition> definitions) {
//Definitions list gotten from code above
definitionsMap = new HashMap<>();
this.definitions = definitions;
definitions.forEach(def -> definitionsMap.put(def.getUrl(), def));
}
@Override
public ValueSet.ValueSetExpansionComponent expandValueSet(FhirContext theContext, ValueSet.ConceptSetComponent theInclude) {
return null;
}
@Override
public List<IBaseResource> fetchAllConformanceResources(FhirContext theContext) {
return null;
}
@Override
public List<StructureDefinition> fetchAllStructureDefinitions(FhirContext theContext) {
return definitions;
}
@Override
public CodeSystem fetchCodeSystem(FhirContext theContext, String theSystem) {
return null;
}
@Override
public <T extends IBaseResource> T fetchResource(FhirContext theContext, Class<T> theClass, String theUri) {
return (T) definitionsMap.get(theUri);
}
@Override
public StructureDefinition fetchStructureDefinition(FhirContext theCtx, String theUrl) {
return definitionsMap.get(theUrl);
}
@Override
public boolean isCodeSystemSupported(FhirContext theContext, String theSystem) {
return false;
}
@Override
public CodeValidationResult validateCode(FhirContext theContext, String theCodeSystem, String theCode, String theDisplay) {
return null;
}
}
Last updated: Apr 12 2022 at 19:14 UTC