-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stand-alone validator working, workaround for icd10-gm, ops, pzn
Added a "code ok" validation support impl that assumes that codes from http://fhir.de/CodeSystem/bfarm/icd-10-gm, http://fhir.de/CodeSystem/dimdi/icd-10-gm, http://fhir.de/CodeSystem/bfarm/ops, http://fhir.de/CodeSystem/dimdi/ops, http://fhir.de/CodeSystem/ifa/pzn are always valid, this workaround is fine if the codes are later checked against an expanded ValueSet. Fixed copy-dependencies build step for stand-alone validator
- Loading branch information
Showing
6 changed files
with
136 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
...taetsmedizin/codex/processes/data_transfer/validation/NonValidatingValidationSupport.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package de.netzwerk_universitaetsmedizin.codex.processes.data_transfer.validation; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Arrays; | ||
import java.util.Collection; | ||
import java.util.List; | ||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import ca.uhn.fhir.context.FhirContext; | ||
import ca.uhn.fhir.context.support.ConceptValidationOptions; | ||
import ca.uhn.fhir.context.support.IValidationSupport; | ||
import ca.uhn.fhir.context.support.ValidationSupportContext; | ||
|
||
public class NonValidatingValidationSupport implements IValidationSupport | ||
{ | ||
private static final Logger logger = LoggerFactory.getLogger(NonValidatingValidationSupport.class); | ||
|
||
private final FhirContext fhirContext; | ||
private final List<String> notValidatedCodeSystemSystems = new ArrayList<>(); | ||
|
||
public NonValidatingValidationSupport(FhirContext fhirContext, String... notValidatedCodeSystemSystems) | ||
{ | ||
this(fhirContext, Arrays.asList(notValidatedCodeSystemSystems)); | ||
} | ||
|
||
public NonValidatingValidationSupport(FhirContext fhirContext, Collection<String> notValidatedCodeSystemSystems) | ||
{ | ||
this.fhirContext = fhirContext; | ||
|
||
if (notValidatedCodeSystemSystems != null) | ||
this.notValidatedCodeSystemSystems.addAll(notValidatedCodeSystemSystems); | ||
} | ||
|
||
@Override | ||
public FhirContext getFhirContext() | ||
{ | ||
return fhirContext; | ||
} | ||
|
||
@Override | ||
public CodeValidationResult validateCode(ValidationSupportContext theValidationSupportContext, | ||
ConceptValidationOptions theOptions, String system, String code, String display, String valueSetUrl) | ||
{ | ||
if (notValidatedCodeSystemSystems.contains(system)) | ||
{ | ||
logger.warn("Not validating code {} from system {} for valueSet {}", code, system, valueSetUrl); | ||
return new CodeValidationResult().setCode(code).setCodeSystemName(system).setDisplay(display); | ||
} | ||
|
||
else | ||
return null; | ||
} | ||
|
||
@Override | ||
public boolean isCodeSystemSupported(ValidationSupportContext theValidationSupportContext, String system) | ||
{ | ||
return notValidatedCodeSystemSystems.contains(system); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters