Skip to content

Commit

Permalink
v3.8.8 #259
Browse files Browse the repository at this point in the history
  • Loading branch information
oliveregger committed Jun 25, 2024
1 parent 3d5023b commit ea20645
Show file tree
Hide file tree
Showing 13 changed files with 102 additions and 19 deletions.
9 changes: 9 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,15 @@
"vmArgs": "-Dspring.config.additional-location=file:../../matchbox-int-tests/src/test/resources/application-validate-r4-ch-epr-fhir.yaml",
"cwd": "${workspaceFolder}/matchbox-server"
},
{
"type": "java",
"name": "Launch Matchbox-Server (int-tests ch)",
"request": "launch",
"mainClass": "ca.uhn.fhir.jpa.starter.Application",
"projectName": "matchbox-server",
"vmArgs": "-Dspring.config.additional-location=file:../../matchbox-int-tests/src/test/resources/application-validate-r4-ch.yaml",
"cwd": "${workspaceFolder}/matchbox-server"
},
{
"type": "java",
"name": "Launch Matchbox-Server (test)",
Expand Down
6 changes: 6 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2024/06/25 Release 3.8.8

- validation for 3 letter country codes [#259](https://github.com/ahdis/matchbox/issues/259)
- making caching of txServer configurable
- add support for dateTime [#243](https://github.com/ahdis/matchbox/issues/243)

2024/06/24 Release 3.8.7

- docker image for v3.8.6 not starting up [#258](https://github.com/ahdis/matchbox/issues/258)
Expand Down
2 changes: 1 addition & 1 deletion matchbox-engine/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<artifactId>matchbox</artifactId>
<groupId>health.matchbox</groupId>
<version>3.8.7</version>
<version>3.8.8</version>
</parent>

<artifactId>matchbox-engine</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -832,8 +832,12 @@ public enum FilesystemPackageCacheMode {
* @throws IOException
*/
public void initTxCache(String cacheDir) throws FileNotFoundException, FHIRException, IOException {
getContext().initTxCache(cacheDir);
getContext().setCachingAllowed(true);
if (cacheDir !=null) {
getContext().initTxCache(cacheDir);
getContext().setCachingAllowed(true);
} else {
getContext().setCachingAllowed(false);
}
}

}
2 changes: 1 addition & 1 deletion matchbox-frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "matchbox",
"version": "3.8.7",
"version": "3.8.8",
"license": "MIT",
"scripts": {
"ng": "ng",
Expand Down
2 changes: 1 addition & 1 deletion matchbox-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>matchbox</artifactId>
<groupId>health.matchbox</groupId>
<version>3.8.7</version>
<version>3.8.8</version>
</parent>

<artifactId>matchbox-server</artifactId>
Expand Down
20 changes: 19 additions & 1 deletion matchbox-server/src/main/java/ch/ahdis/matchbox/CliContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,11 @@ public CliContext setExtensions(List<String> extensions) {
// @JsonProperty("htmlOutput")
// private String htmlOutput = null;
@JsonProperty("txServer")
private String txServer = "http://tx.fhir.org";
private String txServer = null;

@JsonProperty("txServerCache")
private boolean txServerCache = true;

// @JsonProperty("sv")
// private String sv = null;
// @JsonProperty("txLog")
Expand Down Expand Up @@ -289,6 +293,16 @@ public void setTxServer(String txServer) {
this.txServer = txServer;
}

@JsonProperty("txServerCache")
public boolean getTxServerCache() {
return txServerCache;
}

@JsonProperty("txServerCache")
public void setTxServerCache(boolean txServerCache) {
this.txServerCache = txServerCache;
}

@JsonProperty("doNative")
public boolean isDoNative() {
return doNative;
Expand Down Expand Up @@ -597,6 +611,7 @@ public boolean equals(final Object o) {
&& htmlInMarkdownCheck == that.htmlInMarkdownCheck
&& Objects.equals(extensions, that.extensions)
&& Objects.equals(txServer, that.txServer)
&& txServerCache == that.txServerCache
&& Objects.equals(lang, that.lang)
&& Objects.equals(snomedCT, that.snomedCT)
&& Objects.equals(fhirVersion, that.fhirVersion)
Expand Down Expand Up @@ -633,6 +648,7 @@ public int hashCode() {
allowExampleUrls,
htmlInMarkdownCheck,
txServer,
txServerCache,
lang,
snomedCT,
fhirVersion,
Expand Down Expand Up @@ -666,6 +682,7 @@ public String toString() {
", doImplicitFHIRPathStringConversion=" + doImplicitFHIRPathStringConversion +
", htmlInMarkdownCheck=" + htmlInMarkdownCheck +
", txServer='" + txServer + '\'' +
", txServerCache='" + txServerCache + '\'' +
", lang='" + lang + '\'' +
", snomedCT='" + snomedCT + '\'' +
", fhirVersion='" + fhirVersion + '\'' +
Expand Down Expand Up @@ -717,6 +734,7 @@ public void addContextToExtension(final Extension ext) {
addExtension(ext, "httpReadOnly", new BooleanType(this.httpReadOnly));
addExtension(ext, "allowExampleUrls", new BooleanType(this.allowExampleUrls));
addExtension(ext, "txServer", new UriType(this.txServer));
addExtension(ext, "txServerCache", new BooleanType(this.txServerCache));
addExtension(ext, "lang", new StringType(this.lang));
addExtension(ext, "snomedCT", new StringType(this.snomedCT));
addExtension(ext, "fhirVersion", new StringType(this.fhirVersion));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,9 @@ private String getTxCachePath(String txServer) {
private void configureValidationEngine(final MatchboxEngine validator,
final CliContext cli) throws MatchboxEngineCreationException {
log.info("Terminology server {}", cli.getTxServer());
if (cli.getTxServer() == null) {
throw new MatchboxEngineCreationException("Terminology server is not set, you need to set it in the configuration file.");
}
if ("n/a".equals(cli.getTxServer())) {
validator.getContext().setCanRunWithoutTerminology(true);
validator.getContext().setNoTerminologyServer(true);
Expand All @@ -470,13 +473,14 @@ private void configureValidationEngine(final MatchboxEngine validator,
validator.getContext().setNoTerminologyServer(false);

try {
// set "txLog" for second parameter to activate
final String txver = validator.setTerminologyServer(cli.getTxServer(), null, FhirPublication.R4, true);
log.debug("Version of the terminology server: {}", txver);
} catch (final Exception e) {
throw new TerminologyServerException("Error while setting the terminology server: " + e.getMessage(), e);
}
try {
validator.initTxCache(getTxCachePath(cli.getTxServer()));
validator.initTxCache(cli.getTxServerCache() ? getTxCachePath(cli.getTxServer()) : null);
} catch (final Exception e) {
throw new TerminologyServerException("Error while setting the terminology server cache: " + getTxCachePath(cli.getTxServer()), e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ private CodeMembership evaluateCodeInComposition(final Coding coding,

for (final var filter : include.getFilter()) {
if ("regex".equals(filter.getOp().toCode())) {
final var pattern = Pattern.compile(filter.getOp().toCode());
final var pattern = Pattern.compile(filter.getValue());
// Try to match the full code with the regex
if (!pattern.matcher(coding.getCode()).matches()) {
return CodeMembership.EXCLUDED;
Expand Down
33 changes: 32 additions & 1 deletion matchbox-server/validation-ch-samples.http
Original file line number Diff line number Diff line change
Expand Up @@ -434,4 +434,35 @@ GET {{host}}/ImplementationGuide

###
GET {{host}}/ImplementationGuide/ch.fhir.ig.ch-vacd-3.0.0 HTTP/1.1
Accept: application/gzip
Accept: application/gzip

### CH-Core Franz Muster )
POST {{host}}/$validate?profile=http://fhir.ch/ig/ch-core/StructureDefinition/ch-core-patient HTTP/1.1
Content-Type: application/fhir+xml; charset=UTF-8

<Patient xmlns="http://hl7.org/fhir">
<id value="Pat-LillyLiechtenstein"/>
<identifier>
<system value="urn:oid:2.16.438.10.20.10.10.1.2.1"/>
<value value="1234567890123"/>
</identifier>
<name>
<family value="Liechtenstein"/>
<given value="Lilly"/>
</name>
<gender value="female"/>
<birthDate value="2000-09-14"/>
<address>
<use value="home"/>
<state value="FL"/>
<country value="LI">
<extension
url="http://hl7.org/fhir/StructureDefinition/iso21090-SC-coding">
<valueCoding>
<system value="urn:iso:std:iso:3166"/>
<code value="LIE"/>
</valueCoding>
</extension>
</country>
</address>
</Patient>
28 changes: 20 additions & 8 deletions matchbox-server/with-ch/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,38 @@ hapi:
ch-emed:
name: ch.fhir.ig.ch-emed
version: 5.0.0-ballot
url: https://fhir.ch/ig/ch-emed/package.tgz
ch-ips:
name: ch.fhir.ig.ch-ips
version: 1.0.0-ballot
url: https://fhir.ch/ig/ch-ips/package.tgz
ch-vacd:
name: ch.fhir.ig.ch-vacd
version: 5.0.0-ballot
url: https://fhir.ch/ig/ch-vacd/package.tgz
ch-allergyintolerance:
name: ch.fhir.ig.ch-allergyintolerance
version: 3.0.0-ballot
url: https://fhir.ch/ig/ch-allergyintolerance/package.tgz
ch-lab-report:
name: ch.fhir.ig.ch-lab-report
version: 1.0.0-ballot
url: https://fhir.ch/ig/ch-lab-report/package.tgz
staticLocation: file:/apps/
version: 1.0.0-ballot
ch-lab-order:
name: ch.fhir.ig.ch-lab-order
version: 2.0.0
ch-rad-order:
name: ch.fhir.ig.ch-rad-order
version: 2.0.0-ballot
ch-etoc:
name: ch.fhir.ig.ch-etoc
version: 3.0.0-ballot
ch-epr-fhir:
name: ch.fhir.ig.ch-epr-fhir
version: 4.0.1-ballot
ch-atc:
name: ch.fhir.ig.ch-atc
version: 3.3.0-ballot
matchbox:
fhir:
context:
fhirVersion: 4.0.1
txServer: http://tx.fhir.org
txServer: http://tx.fhir.org
suppressWarnInfo:
hl7.fhir.r4.core#4.0.1:
- "Constraint failed: dom-6:"
1 change: 0 additions & 1 deletion matchbox-server/with-elm/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ matchbox:
context:
fhirVersion: 4.0.1
txServer: http://localhost:${server.port}/matchboxv3/fhir
# txServer: http://tx.fhir.org
suppressWarnInfo:
hl7.fhir.r4.core#4.0.1:
- "Constraint failed: dom-6:"
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<groupId>health.matchbox</groupId>
<artifactId>matchbox</artifactId>
<version>3.8.7</version>
<version>3.8.8</version>
<packaging>pom</packaging>
<name>matchbox</name>
<description>An open-source implementation to support testing and implementation of FHIR based solutions and map or
Expand Down

0 comments on commit ea20645

Please sign in to comment.