Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cored to 6.3.30 and FML patch for identity #290

Merged
merged 6 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -229,3 +229,5 @@ database/h2.trace.db

.apt_generated_tests
matchbox-server/tx.html

matchbox-server/test.html
4 changes: 4 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
Unreleased

- Tutorial for validation FHIR resources with [matchbox](https://ahdis.github.io/matchbox/validation-tutorial/)
- Gazelle reports: add test to ensure https://gazelle.ihe.net/jira/browse/EHS-831 is fixed
- Allow validating a resource through the GUI with URL search parameters [#288](https://github.com/ahdis/matchbox/issues/288)
- Terminology: support CodeableConcept in ValueSet/$validate operation [#291](https://github.com/ahdis/matchbox/issues/291)
- Upgrade hapifhir org.hl7.fhir.core to 6.3.31
- FML: Use FMLParser in StructureMapUtilities and support for identity transform [#289](https://github.com/ahdis/matchbox/issues/289)

2024/10/07 Release 3.9.3

Expand Down
3 changes: 3 additions & 0 deletions docs/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ matchbox:
|----------------------|-------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| implementationguides | 0..\* | the Implementation Guide and version which with which matchbox will be configured, you can provide by classpath, file, http address, if none is specified the FHIR package servers will be used (need to be online) |
| txServer | 0..1 | txServer to use, n/a if none (default), http://localhost:8080/fhir for internal (if server.port in application.yaml is 8080), http://tx.fhir.org for hl7 validator |
| txUseEcosystem | 0..1 | boolean true if none (default), if true asks tx servers for which CodeSystem they are authorative |
| txServerCache | 0..1 | boolean if respones are cached, true if none (default) |
| txLog | 0..1 | string indicating file location of log (end either in .txt or .html, default no logging |
| igsPreloaded | 0..\* | For each mentioned ImplementationGuide (comma separated) an engine will be created, which will be cached in memory as long the application is running. Other IG's will created on demand and will be cached for an hour for subsequent calls. Tradeoff between memory consumption and first response time (creating of engine might have duration of half a minute). Default no igs are preloaded. |
| onlyOneEngine | 0..1 | Implementation Guides can have multiple versions with different dependencies. Matchbox creates for transformation and validation an own engine for each Implementation Guide and its dependencies (default setting). You can switch this behavior, e.g. if you are using it in development and want to create and update resources or transform maps. Set the setting for onlyOneEngine to true. The changes are however not persisted and will be lost if matchbox is restarted. |
| httpReadOnly | 0..1 | Whether to allow creating, modifying or deleting resources on the server via the HTTP API or not. If `true`, IGs can only be loaded through the configuration. |
Expand Down
4 changes: 4 additions & 0 deletions matchbox-engine/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>org.hl7.fhir.utilities</artifactId>
</dependency>
<dependency>
<groupId>org.fhir</groupId>
<artifactId>ucum</artifactId>
</dependency>

<!-- Manual upgrade of Jackson -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,16 @@ public IBaseResource getCanonicalResourceById(final String type, final @NonNull
* @throws FHIRException FHIR Exception
*/
public org.hl7.fhir.r5.model.StructureMap parseMapR5(String content) throws FHIRException {
SimpleWorkerContext context = this.getContext();
SimpleWorkerContext context = null;
try {
context = this.getContextForFhirVersion("5.0.0");
} catch (FHIRException e) {
log.error("error creating context",e);
return null;
} catch (IOException e) {
log.error("error creating context",e);
return null;
}
List<Base> outputs = new ArrayList<>();
StructureMapUtilities scu = new MatchboxStructureMapUtilities(context,
new TransformSupportServices(context, outputs), this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import org.hl7.fhir.r5.utils.validation.IResourceValidator;
import org.hl7.fhir.r5.utils.validation.constants.ReferenceValidationPolicy;
import org.hl7.fhir.validation.instance.BasePolicyAdvisorForFullValidation;
import org.hl7.fhir.validation.instance.advisor.BasePolicyAdvisorForFullValidation;
import org.hl7.fhir.validation.instance.InstanceValidator;

public class ValidationPolicyAdvisor extends BasePolicyAdvisorForFullValidation {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1283,9 +1283,9 @@ public ValidationResult validateCode(final ValidationOptions optionsArg, final C
}

public ValidationResult validateCode(final ValidationOptions optionsArg, String path, final Coding code, final ValueSet vs, final ValidationContextCarrier ctxt) {

ValidationOptions options = optionsArg != null ? optionsArg : ValidationOptions.defaults();

if (code.hasSystem()) {
codeSystemsUsed.add(code.getSystem());
}
Expand All @@ -1310,6 +1310,9 @@ public ValidationResult validateCode(final ValidationOptions optionsArg, String
// ok, first we try to validate locally
try {
ValueSetValidator vsc = constructValueSetCheckerSimple(options, vs, ctxt);
if (vsc.getOpContext() != null) {
vsc.getOpContext().note("Validate "+code.toString()+" @ "+path+" against "+(vs == null ? "null" : vs.getVersionedUrl()));
}
vsc.setUnknownSystems(unknownSystems);
vsc.setThrowToServer(options.isUseServer() && terminologyClientManager.hasClient());
if (!ValueSetUtilities.isServerSide(code.getSystem())) {
Expand Down Expand Up @@ -1478,15 +1481,15 @@ public Boolean processSubsumesResult(Parameters pOut, String server) {
}

protected ValueSetExpander constructValueSetExpanderSimple(ValidationOptions options) {
return new ValueSetExpander(this, new TerminologyOperationContext(this, options)).setDebug(logger.isDebugLogging());
return new ValueSetExpander(this, new TerminologyOperationContext(this, options, "expansion")).setDebug(logger.isDebugLogging());
}

protected ValueSetValidator constructValueSetCheckerSimple(ValidationOptions options, ValueSet vs, ValidationContextCarrier ctxt) {
return new ValueSetValidator(this, new TerminologyOperationContext(this, options), options, vs, ctxt, expParameters, terminologyClientManager);
return new ValueSetValidator(this, new TerminologyOperationContext(this, options, "validation"), options, vs, ctxt, expParameters, terminologyClientManager);
}

protected ValueSetValidator constructValueSetCheckerSimple( ValidationOptions options, ValueSet vs) {
return new ValueSetValidator(this, new TerminologyOperationContext(this, options), options, vs, expParameters, terminologyClientManager);
return new ValueSetValidator(this, new TerminologyOperationContext(this, options, "validation"), options, vs, expParameters, terminologyClientManager);
}

protected Parameters constructParameters(TerminologyClientContext tcd, ValueSet vs, boolean hierarchical) {
Expand Down Expand Up @@ -1650,7 +1653,11 @@ public ValidationResult validateCode(ValidationOptions options, CodeableConcept
Parameters pIn = constructParameters(options, code);
res = validateOnServer(tc, vs, pIn, options);
} catch (Exception e) {
res = new ValidationResult(IssueSeverity.ERROR, e.getMessage() == null ? e.getClass().getName() : e.getMessage(), null).setTxLink(txLog == null ? null : txLog.getLastId());
issues.clear();
OperationOutcomeIssueComponent iss = new OperationOutcomeIssueComponent(org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.ERROR, org.hl7.fhir.r5.model.OperationOutcome.IssueType.EXCEPTION);
iss.getDetails().setText(e.getMessage());
issues.add(iss);
res = new ValidationResult(IssueSeverity.ERROR, e.getMessage() == null ? e.getClass().getName() : e.getMessage(), issues).setTxLink(txLog == null ? null : txLog.getLastId()).setErrorClass(TerminologyServiceErrorClass.SERVER_ERROR);
}
if (cachingAllowed) {
txCache.cacheValidation(cacheToken, res, TerminologyCache.PERMANENT);
Expand Down Expand Up @@ -1764,6 +1771,10 @@ protected void addServerValidationParameters(TerminologyClientContext terminolog
} else if (options.getVsAsUrl()){
pin.addParameter().setName("url").setValue(new UriType(vs.getUrl()));
} else {
if (vs.hasCompose() && vs.hasExpansion()) {
vs = vs.copy();
vs.setExpansion(null);
}
pin.addParameter().setName("valueSet").setResource(vs);
if (vs.getUrl() != null) {
terminologyClientContext.getCached().add(vs.getUrl()+"|"+ vs.getVersion());
Expand All @@ -1786,6 +1797,7 @@ protected void addServerValidationParameters(TerminologyClientContext terminolog
if (options.isDisplayWarningMode()) {
pin.addParameter("mode","lenient-display-validation");
}
pin.addParameter("diagnostics", true);
}

private boolean addDependentResources(TerminologyClientContext tc, Parameters pin, ValueSet vs) {
Expand Down
Loading
Loading