Merge pull request #1494 from hapifhir/2023-11-gg-misc1

2023 11 gg misc1
This commit is contained in:
Grahame Grieve 2023-11-24 12:56:37 +11:00 committed by GitHub
commit 7f42c7aa71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
81 changed files with 6027 additions and 521 deletions

View File

@ -1,7 +1,18 @@
## Validator Changes
* no changes
* Rework bundle references validation for R4+ - this is a *significant* change - many existing bundles that were previously erroneously passing will now fail
* #1488 - don't fail on erroneously repeating elements
* Fix problem creating CDA type discriminators
* Fix problem with R3 expansion
* Add support for CCDA .hasTemplateIdOf(canonical)
* Add support for NZ IPS
## Other code changes
* no changes
* Start work on making IWorkerContext a versioned API
* Add fhirVersion to R5 Base and IWorkerContext methods
* move IContextResourceLoader, ValidationResult and CodingValidationRequest out of IWorkerContext to their own clasess
* Fix up VSAC import for large value sets
* fix FHIRPath cda tests for empty package cache
* Fix issue where markdown with multiple characters was being cut off sometimes when rendering profiles

View File

@ -2,11 +2,15 @@ package org.hl7.fhir.convertors.misc;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.URISyntaxException;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.hl7.fhir.exceptions.FHIRException;
@ -24,9 +28,12 @@ import org.hl7.fhir.r4.utils.client.FHIRToolingClient;
import org.hl7.fhir.r4.terminologies.JurisdictionUtilities;
import org.hl7.fhir.utilities.CSVReader;
import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.utilities.json.model.JsonArray;
import org.hl7.fhir.utilities.json.model.JsonObject;
import org.hl7.fhir.utilities.json.model.JsonProperty;
public class VSACImporter extends OIDBasedValueSetImporter {
public VSACImporter() throws FHIRException, IOException {
super();
init();
@ -45,54 +52,25 @@ public class VSACImporter extends OIDBasedValueSetImporter {
FHIRToolingClient fhirToolingClient = new FHIRToolingClient("https://cts.nlm.nih.gov/fhir", "fhir/vsac");
fhirToolingClient.setUsername("apikey");
fhirToolingClient.setPassword(apiKey);
fhirToolingClient.setTimeout(120000);
fhirToolingClient.setTimeoutNormal(6000);
CapabilityStatement cs = fhirToolingClient.getCapabilitiesStatement();
JsonParser json = new JsonParser();
json.setOutputStyle(OutputStyle.PRETTY).compose(new FileOutputStream(Utilities.path("[tmp]", "vsac-capability-statmenet.json")), cs);
int i = 0;
int j = 0;
System.out.println("Loading");
List<String> oids = new ArrayList<>();
while (csv.line()) {
String oid = csv.cell("OID");
oids.add(oid);
}
Collections.sort(oids);
System.out.println("Go: "+oids.size()+" oids");
int i = 0;
int j = 0;
for (String oid : oids) {
try {
if (!onlyNew || !(new File(Utilities.path(dest, "ValueSet-" + oid + ".json")).exists())) {
ValueSet vs = fhirToolingClient.read(ValueSet.class, oid);
try {
ValueSet vse = fhirToolingClient.expandValueset(vs.getUrl(), null);
vs.setExpansion(vse.getExpansion());
j++;
} catch (Exception e) {
errs.put(oid, "Expansion: " +e.getMessage());
System.out.println(e.getMessage());
}
while (isIncomplete(vs.getExpansion())) {
Parameters p = new Parameters();
p.addParameter("offset", vs.getExpansion().getParameter("offset").getValueIntegerType().getValue() + vs.getExpansion().getParameter("count").getValueIntegerType().getValue());
ValueSet vse = fhirToolingClient.expandValueset(vs.getUrl(), p);
vs.getExpansion().getContains().addAll(vse.getExpansion().getContains());
vs.getExpansion().setParameter(vse.getExpansion().getParameter());
}
vs.getExpansion().setOffsetElement(null);
vs.getExpansion().getParameter().clear();
if (vs.hasTitle()) {
if (vs.getTitle().equals(vs.getDescription())) {
vs.setTitle(vs.getName());
} else {
// System.out.println(oid);
// System.out.println(" name: "+vs.getName());
// System.out.println(" title: "+vs.getTitle());
// System.out.println(" desc: "+vs.getDescription());
}
} else {
vs.setTitle(vs.getName());
}
vs.setName(makeValidName(vs.getName()));
JurisdictionUtilities.setJurisdictionCountry(vs.getJurisdiction(), "US");
new JsonParser().setOutputStyle(OutputStyle.PRETTY).compose(new FileOutputStream(Utilities.path(dest, "ValueSet-" + oid + ".json")), vs);
}
j = processOid(dest, onlyNew, errs, fhirToolingClient, j, oid.trim());
i++;
if (i % 100 == 0) {
System.out.println(":"+i+" ("+j+")");
@ -110,6 +88,62 @@ public class VSACImporter extends OIDBasedValueSetImporter {
System.out.println("Done. " + i + " ValueSets");
}
private int processOid(String dest, boolean onlyNew, Map<String, String> errs, FHIRToolingClient fhirToolingClient, int j, String oid)
throws IOException, InterruptedException, FileNotFoundException {
if (!onlyNew || !(new File(Utilities.path(dest, "ValueSet-" + oid + ".json")).exists())) {
ValueSet vs = null;
try {
vs = fhirToolingClient.read(ValueSet.class, oid);
} catch (Exception e) {
errs.put(oid, "Read: " +e.getMessage());
System.out.println("Read "+oid+" failed: "+e.getMessage());
}
if (vs != null) {
try {
ValueSet vse = fhirToolingClient.expandValueset(vs.getUrl(), null);
vs.setExpansion(vse.getExpansion());
j++;
} catch (Exception e) {
errs.put(oid, "Expansion: " +e.getMessage());
System.out.println("Expand "+oid+" failed: "+e.getMessage());
}
while (isIncomplete(vs.getExpansion())) {
Parameters p = new Parameters();
int offset = vs.getExpansion().getParameter("offset").getValueIntegerType().getValue() + vs.getExpansion().getParameter("count").getValueIntegerType().getValue();
p.addParameter("offset", offset);
try {
ValueSet vse = fhirToolingClient.expandValueset(vs.getUrl(), p);
vs.getExpansion().getContains().addAll(vse.getExpansion().getContains());
vs.getExpansion().setParameter(vse.getExpansion().getParameter());
} catch (Exception e2) {
errs.put(oid, "Expansion: " +e2.getMessage()+" @ "+offset);
System.out.println("Expand "+oid+" @ "+offset+" failed: "+e2.getMessage());
}
}
vs.getExpansion().setOffsetElement(null);
vs.getExpansion().getParameter().clear();
if (vs.hasTitle()) {
if (vs.getTitle().equals(vs.getDescription())) {
vs.setTitle(vs.getName());
} else {
// System.out.println(oid);
// System.out.println(" name: "+vs.getName());
// System.out.println(" title: "+vs.getTitle());
// System.out.println(" desc: "+vs.getDescription());
}
} else {
vs.setTitle(vs.getName());
}
vs.setName(makeValidName(vs.getName()));
JurisdictionUtilities.setJurisdictionCountry(vs.getJurisdiction(), "US");
new JsonParser().setOutputStyle(OutputStyle.PRETTY).compose(new FileOutputStream(Utilities.path(dest, "ValueSet-" + oid + ".json")), vs);
}
}
return j;
}
private boolean isIncomplete(ValueSetExpansionComponent expansion) {
IntegerType c = expansion.getParameter("count").getValueIntegerType();
IntegerType offset = expansion.getParameter("offset").getValueIntegerType();

View File

@ -125,8 +125,8 @@ public class TerminologyClientR2 implements ITerminologyClient {
}
@Override
public ITerminologyClient setTimeout(int i) {
client.setTimeout(i);
public ITerminologyClient setTimeoutFactor(int i) {
client.setTimeoutFactor(i);
return this;
}

View File

@ -123,8 +123,8 @@ public class TerminologyClientR3 implements ITerminologyClient {
}
@Override
public ITerminologyClient setTimeout(int i) {
client.setTimeout(i);
public ITerminologyClient setTimeoutFactor(int i) {
client.setTimeoutFactor(i);
return this;
}

View File

@ -133,8 +133,8 @@ public class TerminologyClientR4 implements ITerminologyClient {
}
@Override
public ITerminologyClient setTimeout(int i) {
client.setTimeout(i);
public ITerminologyClient setTimeoutFactor(int i) {
client.setTimeoutFactor(i);
return this;
}

View File

@ -117,8 +117,8 @@ public class TerminologyClientR5 implements ITerminologyClient {
}
@Override
public ITerminologyClient setTimeout(int i) {
client.setTimeout(i);
public ITerminologyClient setTimeoutFactor(int i) {
client.setTimeoutFactor(i);
return this;
}

View File

@ -21,7 +21,7 @@
"telecom": [
{
"system": "url",
"value": "http://hl7.org/special/committees/FHIR"
"value": "http://www.hl7.org/Special/committees/FHIR"
}
]
}

View File

@ -21,7 +21,7 @@
"telecom": [
{
"system": "url",
"value": "http://hl7.org/special/committees/FHIR"
"value": "http://www.hl7.org/Special/committees/FHIR"
}
]
}

View File

@ -22,7 +22,7 @@
"telecom": [
{
"system": "url",
"value": "http://hl7.org/special/committees/fhir.htm"
"value": "http://www.hl7.org/Special/committees/fhir.htm"
}
]
}

View File

@ -22,7 +22,7 @@
"telecom": [
{
"system": "url",
"value": "http://hl7.org/special/committees/fhir.htm"
"value": "http://www.hl7.org/Special/committees/fhir.htm"
}
]
}

View File

@ -48,6 +48,7 @@ import org.hl7.fhir.dstu2.model.PrimitiveType;
import org.hl7.fhir.dstu2.model.Resource;
import org.hl7.fhir.dstu2.model.StringType;
import org.hl7.fhir.dstu2.model.ValueSet;
import org.hl7.fhir.utilities.FHIRBaseToolingClient;
import org.hl7.fhir.utilities.ToolingClientLogger;
import org.hl7.fhir.utilities.Utilities;
@ -81,15 +82,12 @@ import org.hl7.fhir.utilities.Utilities;
* @author Claude Nanjo
*
*/
public class FHIRToolingClient {
public class FHIRToolingClient extends FHIRBaseToolingClient {
public static final String DATETIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ssK";
public static final String DATE_FORMAT = "yyyy-MM-dd";
public static final String hostKey = "http.proxyHost";
public static final String portKey = "http.proxyPort";
private static final int TIMEOUT_NORMAL = 1;
private static final int TIMEOUT_OPERATION = 2;
private static final int TIMEOUT_OPERATION_LONG = 3;
private String base;
private ResourceAddress resourceAddress;
@ -179,11 +177,11 @@ public class FHIRToolingClient {
try {
if (useOptionsVerb) {
conformance = (Conformance) utils
.issueOptionsRequest(resourceAddress.getBaseServiceUri(), getPreferredResourceFormat(), TIMEOUT_NORMAL)
.issueOptionsRequest(resourceAddress.getBaseServiceUri(), getPreferredResourceFormat(), timeoutNormal)
.getReference();// TODO fix this
} else {
conformance = (Conformance) utils.issueGetResourceRequest(resourceAddress.resolveMetadataUri(false),
getPreferredResourceFormat(), TIMEOUT_NORMAL).getReference();
getPreferredResourceFormat(), timeoutNormal).getReference();
}
} catch (Exception e) {
handleException("An error has occurred while trying to fetch the server's conformance statement", e);
@ -202,11 +200,11 @@ public class FHIRToolingClient {
try {
if (useOptionsVerb) {
conformance = (Conformance) utils
.issueOptionsRequest(resourceAddress.getBaseServiceUri(), getPreferredResourceFormat(), TIMEOUT_NORMAL)
.issueOptionsRequest(resourceAddress.getBaseServiceUri(), getPreferredResourceFormat(), timeoutNormal)
.getReference();// TODO fix this
} else {
conformance = (Conformance) utils.issueGetResourceRequest(resourceAddress.resolveMetadataUri(true),
getPreferredResourceFormat(), TIMEOUT_NORMAL).getReference();
getPreferredResourceFormat(), timeoutNormal).getReference();
}
} catch (Exception e) {
handleException("An error has occurred while trying to fetch the server's conformance statement", e);
@ -218,7 +216,7 @@ public class FHIRToolingClient {
ResourceRequest<T> result = null;
try {
result = utils.issueGetResourceRequest(resourceAddress.resolveGetUriFromResourceClassAndId(resourceClass, id),
getPreferredResourceFormat(), TIMEOUT_NORMAL);
getPreferredResourceFormat(), timeoutNormal);
result.addErrorStatus(410);// gone
result.addErrorStatus(404);// unknown
result.addSuccessStatus(200);// Only one for now
@ -237,7 +235,7 @@ public class FHIRToolingClient {
try {
result = utils.issueGetResourceRequest(
resourceAddress.resolveGetUriFromResourceClassAndIdAndVersion(resourceClass, id, version),
getPreferredResourceFormat(), TIMEOUT_NORMAL);
getPreferredResourceFormat(), timeoutNormal);
result.addErrorStatus(410);// gone
result.addErrorStatus(404);// unknown
result.addErrorStatus(405);// unknown
@ -260,7 +258,7 @@ public class FHIRToolingClient {
try {
result = utils.issueGetResourceRequest(
resourceAddress.resolveGetUriFromResourceClassAndCanonical(resourceClass, canonicalURL),
getPreferredResourceFormat(), TIMEOUT_NORMAL);
getPreferredResourceFormat(), timeoutNormal);
result.addErrorStatus(410);// gone
result.addErrorStatus(404);// unknown
result.addErrorStatus(405);// unknown
@ -287,7 +285,7 @@ public class FHIRToolingClient {
result = utils.issuePutRequest(
resourceAddress.resolveGetUriFromResourceClassAndId(resource.getClass(), resource.getId()),
utils.getResourceAsByteArray(resource, false, isJson(getPreferredResourceFormat())),
getPreferredResourceFormat(), headers, TIMEOUT_OPERATION);
getPreferredResourceFormat(), headers, timeoutOperation);
result.addErrorStatus(410);// gone
result.addErrorStatus(404);// unknown
result.addErrorStatus(405);
@ -322,7 +320,7 @@ public class FHIRToolingClient {
List<Header> headers = null;
result = utils.issuePutRequest(resourceAddress.resolveGetUriFromResourceClassAndId(resourceClass, id),
utils.getResourceAsByteArray(resource, false, isJson(getPreferredResourceFormat())),
getPreferredResourceFormat(), headers, TIMEOUT_OPERATION);
getPreferredResourceFormat(), headers, timeoutOperation);
result.addErrorStatus(410);// gone
result.addErrorStatus(404);// unknown
result.addErrorStatus(405);
@ -530,10 +528,10 @@ public class FHIRToolingClient {
if (complex)
result = utils.issuePostRequest(resourceAddress.resolveOperationURLFromClass(resourceClass, name, ps),
utils.getResourceAsByteArray(params, false, isJson(getPreferredResourceFormat())),
getPreferredResourceFormat(), TIMEOUT_OPERATION_LONG);
getPreferredResourceFormat(), timeoutLong);
else
result = utils.issueGetResourceRequest(resourceAddress.resolveOperationURLFromClass(resourceClass, name, ps),
getPreferredResourceFormat(), TIMEOUT_OPERATION_LONG);
getPreferredResourceFormat(), timeoutLong);
result.addErrorStatus(410);// gone
result.addErrorStatus(404);// unknown
result.addSuccessStatus(200);// Only one for now
@ -554,7 +552,7 @@ public class FHIRToolingClient {
try {
transactionResult = utils.postBatchRequest(resourceAddress.getBaseServiceUri(),
utils.getFeedAsByteArray(batch, false, isJson(getPreferredResourceFormat())), getPreferredResourceFormat(),
TIMEOUT_NORMAL + batch.getEntry().size());
timeoutNormal + batch.getEntry().size());
} catch (Exception e) {
handleException("An error occurred trying to process this transaction request", e);
}
@ -721,7 +719,7 @@ public class FHIRToolingClient {
ResourceRequest<Resource> result = utils.issuePostRequest(
resourceAddress.resolveOperationUri(ValueSet.class, "expand"),
utils.getResourceAsByteArray(source, false, isJson(getPreferredResourceFormat())), getPreferredResourceFormat(),
headers, TIMEOUT_OPERATION_LONG);
headers, timeoutLong);
result.addErrorStatus(410);// gone
result.addErrorStatus(404);// unknown
result.addErrorStatus(405);
@ -738,7 +736,7 @@ public class FHIRToolingClient {
public Parameters lookupCode(Map<String, String> params) {
ResourceRequest<Resource> result = utils.issueGetResourceRequest(
resourceAddress.resolveOperationUri(ValueSet.class, "lookup", params), getPreferredResourceFormat(),
TIMEOUT_NORMAL);
timeoutNormal);
result.addErrorStatus(410);// gone
result.addErrorStatus(404);// unknown
result.addErrorStatus(405);
@ -802,7 +800,7 @@ public class FHIRToolingClient {
ResourceRequest<Resource> result = utils.issuePostRequest(
resourceAddress.resolveOperationUri(null, "closure", new HashMap<String, String>()),
utils.getResourceAsByteArray(params, false, isJson(getPreferredResourceFormat())), getPreferredResourceFormat(),
headers, TIMEOUT_NORMAL);
headers, timeoutNormal);
result.addErrorStatus(410);// gone
result.addErrorStatus(404);// unknown
result.addErrorStatus(405);
@ -824,7 +822,7 @@ public class FHIRToolingClient {
ResourceRequest<Resource> result = utils.issuePostRequest(
resourceAddress.resolveOperationUri(null, "closure", new HashMap<String, String>()),
utils.getResourceAsByteArray(params, false, isJson(getPreferredResourceFormat())), getPreferredResourceFormat(),
headers, TIMEOUT_OPERATION);
headers, timeoutOperation);
result.addErrorStatus(410);// gone
result.addErrorStatus(404);// unknown
result.addErrorStatus(405);
@ -864,7 +862,7 @@ public class FHIRToolingClient {
public Parameters getTerminologyCapabilities() {
return (Parameters) utils
.issueGetResourceRequest(resourceAddress.resolveMetadataTxCaps(), getPreferredResourceFormat(), TIMEOUT_NORMAL)
.issueGetResourceRequest(resourceAddress.resolveMetadataTxCaps(), getPreferredResourceFormat(), timeoutNormal)
.getReference();
}
@ -899,4 +897,5 @@ public class FHIRToolingClient {
public void setLanguage(String lang) {
utils.setLanguage(lang);
}
}

View File

@ -49,6 +49,7 @@ import org.hl7.fhir.dstu2016may.model.PrimitiveType;
import org.hl7.fhir.dstu2016may.model.Resource;
import org.hl7.fhir.dstu2016may.model.StringType;
import org.hl7.fhir.dstu2016may.model.ValueSet;
import org.hl7.fhir.utilities.FHIRBaseToolingClient;
import org.hl7.fhir.utilities.ToolingClientLogger;
import org.hl7.fhir.utilities.Utilities;
@ -82,15 +83,12 @@ import org.hl7.fhir.utilities.Utilities;
* @author Claude Nanjo
*
*/
public class FHIRToolingClient {
public class FHIRToolingClient extends FHIRBaseToolingClient {
public static final String DATETIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ssK";
public static final String DATE_FORMAT = "yyyy-MM-dd";
public static final String hostKey = "http.proxyHost";
public static final String portKey = "http.proxyPort";
private static final int TIMEOUT_NORMAL = 1;
private static final int TIMEOUT_OPERATION = 2;
private static final int TIMEOUT_OPERATION_LONG = 3;
private String base;
private ResourceAddress resourceAddress;
@ -177,11 +175,11 @@ public class FHIRToolingClient {
try {
if (useOptionsVerb) {
conformance = (Conformance) utils
.issueOptionsRequest(resourceAddress.getBaseServiceUri(), getPreferredResourceFormat(), TIMEOUT_NORMAL)
.issueOptionsRequest(resourceAddress.getBaseServiceUri(), getPreferredResourceFormat(), timeoutNormal)
.getReference();// TODO fix this
} else {
conformance = (Conformance) utils.issueGetResourceRequest(resourceAddress.resolveMetadataUri(false),
getPreferredResourceFormat(), TIMEOUT_NORMAL).getReference();
getPreferredResourceFormat(), timeoutNormal).getReference();
}
} catch (Exception e) {
handleException("An error has occurred while trying to fetch the server's conformance statement", e);
@ -200,11 +198,11 @@ public class FHIRToolingClient {
try {
if (useOptionsVerb) {
conformance = (Conformance) utils
.issueOptionsRequest(resourceAddress.getBaseServiceUri(), getPreferredResourceFormat(), TIMEOUT_NORMAL)
.issueOptionsRequest(resourceAddress.getBaseServiceUri(), getPreferredResourceFormat(), timeoutNormal)
.getReference();// TODO fix this
} else {
conformance = (Conformance) utils.issueGetResourceRequest(resourceAddress.resolveMetadataUri(true),
getPreferredResourceFormat(), TIMEOUT_NORMAL).getReference();
getPreferredResourceFormat(), timeoutNormal).getReference();
}
} catch (Exception e) {
handleException("An error has occurred while trying to fetch the server's conformance statement", e);
@ -216,7 +214,7 @@ public class FHIRToolingClient {
ResourceRequest<T> result = null;
try {
result = utils.issueGetResourceRequest(resourceAddress.resolveGetUriFromResourceClassAndId(resourceClass, id),
getPreferredResourceFormat(), TIMEOUT_NORMAL);
getPreferredResourceFormat(), timeoutNormal);
result.addErrorStatus(410);// gone
result.addErrorStatus(404);// unknown
result.addSuccessStatus(200);// Only one for now
@ -235,7 +233,7 @@ public class FHIRToolingClient {
try {
result = utils.issueGetResourceRequest(
resourceAddress.resolveGetUriFromResourceClassAndIdAndVersion(resourceClass, id, version),
getPreferredResourceFormat(), TIMEOUT_NORMAL);
getPreferredResourceFormat(), timeoutNormal);
result.addErrorStatus(410);// gone
result.addErrorStatus(404);// unknown
result.addErrorStatus(405);// unknown
@ -258,7 +256,7 @@ public class FHIRToolingClient {
try {
result = utils.issueGetResourceRequest(
resourceAddress.resolveGetUriFromResourceClassAndCanonical(resourceClass, canonicalURL),
getPreferredResourceFormat(), TIMEOUT_NORMAL);
getPreferredResourceFormat(), timeoutNormal);
result.addErrorStatus(410);// gone
result.addErrorStatus(404);// unknown
result.addErrorStatus(405);// unknown
@ -285,7 +283,7 @@ public class FHIRToolingClient {
result = utils.issuePutRequest(
resourceAddress.resolveGetUriFromResourceClassAndId(resource.getClass(), resource.getId()),
utils.getResourceAsByteArray(resource, false, isJson(getPreferredResourceFormat())),
getPreferredResourceFormat(), headers, TIMEOUT_OPERATION);
getPreferredResourceFormat(), headers, timeoutOperation);
result.addErrorStatus(410);// gone
result.addErrorStatus(404);// unknown
result.addErrorStatus(405);
@ -320,7 +318,7 @@ public class FHIRToolingClient {
List<Header> headers = null;
result = utils.issuePutRequest(resourceAddress.resolveGetUriFromResourceClassAndId(resourceClass, id),
utils.getResourceAsByteArray(resource, false, isJson(getPreferredResourceFormat())),
getPreferredResourceFormat(), headers, TIMEOUT_OPERATION);
getPreferredResourceFormat(), headers, timeoutOperation);
result.addErrorStatus(410);// gone
result.addErrorStatus(404);// unknown
result.addErrorStatus(405);
@ -529,10 +527,10 @@ public class FHIRToolingClient {
if (complex)
result = utils.issuePostRequest(resourceAddress.resolveOperationURLFromClass(resourceClass, name, ps),
utils.getResourceAsByteArray(params, false, isJson(getPreferredResourceFormat())),
getPreferredResourceFormat(), TIMEOUT_OPERATION_LONG);
getPreferredResourceFormat(), timeoutLong);
else
result = utils.issueGetResourceRequest(resourceAddress.resolveOperationURLFromClass(resourceClass, name, ps),
getPreferredResourceFormat(), TIMEOUT_OPERATION_LONG);
getPreferredResourceFormat(), timeoutLong);
result.addErrorStatus(410);// gone
result.addErrorStatus(404);// unknown
result.addSuccessStatus(200);// Only one for now
@ -558,7 +556,7 @@ public class FHIRToolingClient {
try {
transactionResult = utils.postBatchRequest(resourceAddress.getBaseServiceUri(),
utils.getFeedAsByteArray(batch, false, isJson(getPreferredResourceFormat())), getPreferredResourceFormat(),
TIMEOUT_NORMAL + batch.getEntry().size());
timeoutNormal + batch.getEntry().size());
} catch (Exception e) {
handleException("An error occurred trying to process this transaction request", e);
}
@ -745,7 +743,7 @@ public class FHIRToolingClient {
public Parameters lookupCode(Map<String, String> params) {
ResourceRequest<Resource> result = utils.issueGetResourceRequest(
resourceAddress.resolveOperationUri(CodeSystem.class, "lookup", params), getPreferredResourceFormat(),
TIMEOUT_NORMAL);
timeoutNormal);
result.addErrorStatus(410);// gone
result.addErrorStatus(404);// unknown
result.addErrorStatus(405);
@ -809,7 +807,7 @@ public class FHIRToolingClient {
ResourceRequest<Resource> result = utils.issuePostRequest(
resourceAddress.resolveOperationUri(null, "closure", new HashMap<String, String>()),
utils.getResourceAsByteArray(params, false, isJson(getPreferredResourceFormat())), getPreferredResourceFormat(),
headers, TIMEOUT_NORMAL);
headers, timeoutNormal);
result.addErrorStatus(410);// gone
result.addErrorStatus(404);// unknown
result.addErrorStatus(405);
@ -831,7 +829,7 @@ public class FHIRToolingClient {
ResourceRequest<Resource> result = utils.issuePostRequest(
resourceAddress.resolveOperationUri(null, "closure", new HashMap<String, String>()),
utils.getResourceAsByteArray(params, false, isJson(getPreferredResourceFormat())), getPreferredResourceFormat(),
headers, TIMEOUT_OPERATION);
headers, timeoutOperation);
result.addErrorStatus(410);// gone
result.addErrorStatus(404);// unknown
result.addErrorStatus(405);
@ -871,7 +869,7 @@ public class FHIRToolingClient {
public Parameters getTerminologyCapabilities() {
return (Parameters) utils
.issueGetResourceRequest(resourceAddress.resolveMetadataTxCaps(), getPreferredResourceFormat(), TIMEOUT_NORMAL)
.issueGetResourceRequest(resourceAddress.resolveMetadataTxCaps(), getPreferredResourceFormat(), timeoutNormal)
.getReference();
}

View File

@ -60,7 +60,7 @@ public enum Hl7WorkGroup {
*/
DEV,
/**
* Electronic Health Records (http://www.hl7.org/special/committees/ehr/index.cfm)
* Electronic Health Records (http://www.hl7.org/Special/committees/ehr/index.cfm)
*/
EHR,
/**
@ -80,11 +80,11 @@ public enum Hl7WorkGroup {
*/
II,
/**
* Infrastructure And Messaging (http://www.hl7.org/special/committees/inm/index.cfm)
* Infrastructure And Messaging (http://www.hl7.org/Special/committees/inm/index.cfm)
*/
INM,
/**
* Implementable Technology Specifications (http://www.hl7.org/special/committees/xml/index.cfm)
* Implementable Technology Specifications (http://www.hl7.org/Special/committees/xml/index.cfm)
*/
ITS,
/**
@ -225,13 +225,13 @@ public enum Hl7WorkGroup {
case CQI: return "Clinical Quality Information (http://www.hl7.org/Special/committees/cqi/index.cfm)";
case CG: return "Clinical Genomics (http://www.hl7.org/Special/committees/clingenomics/index.cfm)";
case DEV: return "Health Care Devices (http://www.hl7.org/Special/committees/healthcaredevices/index.cfm)";
case EHR: return "Electronic Health Records (http://www.hl7.org/special/committees/ehr/index.cfm)";
case EHR: return "Electronic Health Records (http://www.hl7.org/Special/committees/ehr/index.cfm)";
case FHIR: return "FHIR Infrastructure (http://www.hl7.org/Special/committees/fiwg/index.cfm)";
case FM: return "Financial Management (http://www.hl7.org/Special/committees/fm/index.cfm)";
case HSI: return "Health Standards Integration (http://www.hl7.org/Special/committees/hsi/index.cfm)";
case II: return "Imaging Integration (http://www.hl7.org/Special/committees/imagemgt/index.cfm)";
case INM: return "Infrastructure And Messaging (http://www.hl7.org/special/committees/inm/index.cfm)";
case ITS: return "Implementable Technology Specifications (http://www.hl7.org/special/committees/xml/index.cfm)";
case INM: return "Infrastructure And Messaging (http://www.hl7.org/Special/committees/inm/index.cfm)";
case ITS: return "Implementable Technology Specifications (http://www.hl7.org/Special/committees/xml/index.cfm)";
case OO: return "Orders and Observations (http://www.hl7.org/Special/committees/orders/index.cfm)";
case PA: return "Patient Administration (http://www.hl7.org/Special/committees/pafm/index.cfm)";
case PC: return "Patient Care (http://www.hl7.org/Special/committees/patientcare/index.cfm)";

View File

@ -26,6 +26,7 @@ import org.hl7.fhir.dstu3.utils.client.network.ByteUtils;
import org.hl7.fhir.dstu3.utils.client.network.Client;
import org.hl7.fhir.dstu3.utils.client.network.ResourceRequest;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.utilities.FHIRBaseToolingClient;
import org.hl7.fhir.utilities.FhirPublication;
import org.hl7.fhir.utilities.ToolingClientLogger;
import org.hl7.fhir.utilities.Utilities;
@ -58,19 +59,13 @@ import okhttp3.internal.http2.Header;
*
* @author Claude Nanjo
*/
public class FHIRToolingClient {
public class FHIRToolingClient extends FHIRBaseToolingClient {
public static final String DATETIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ssK";
public static final String DATE_FORMAT = "yyyy-MM-dd";
public static final String hostKey = "http.proxyHost";
public static final String portKey = "http.proxyPort";
private static final int TIMEOUT_NORMAL = 1500;
private static final int TIMEOUT_OPERATION = 30000;
private static final int TIMEOUT_ENTRY = 500;
private static final int TIMEOUT_OPERATION_LONG = 60000;
private static final int TIMEOUT_OPERATION_EXPAND = 120000;
private String base;
private ResourceAddress resourceAddress;
private ResourceFormat preferredResourceFormat;
@ -155,7 +150,7 @@ public class FHIRToolingClient {
getPreferredResourceFormat(),
generateHeaders(),
"TerminologyCapabilities",
TIMEOUT_NORMAL).getReference();
timeoutNormal).getReference();
} catch (Exception e) {
throw new FHIRException("Error fetching the server's terminology capabilities", e);
}
@ -169,7 +164,7 @@ public class FHIRToolingClient {
getPreferredResourceFormat(),
generateHeaders(),
"CapabilitiesStatement",
TIMEOUT_NORMAL).getReference();
timeoutNormal).getReference();
} catch (Exception e) {
throw new FHIRException("Error fetching the server's conformance statement", e);
}
@ -183,7 +178,7 @@ public class FHIRToolingClient {
getPreferredResourceFormat(),
generateHeaders(),
"CapabilitiesStatement-Quick",
TIMEOUT_NORMAL).getReference();
timeoutNormal).getReference();
} catch (Exception e) {
throw new FHIRException("Error fetching the server's capability statement: "+e.getMessage(), e);
}
@ -197,7 +192,7 @@ public class FHIRToolingClient {
getPreferredResourceFormat(),
generateHeaders(),
"Read " + resourceClass.getName() + "/" + id,
TIMEOUT_NORMAL);
timeoutNormal);
if (result.isUnsuccessfulRequest()) {
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload());
}
@ -214,7 +209,7 @@ public class FHIRToolingClient {
getPreferredResourceFormat(),
generateHeaders(),
"VRead " + resourceClass.getName() + "/" + id + "/?_history/" + version,
TIMEOUT_NORMAL);
timeoutNormal);
if (result.isUnsuccessfulRequest()) {
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload());
}
@ -231,7 +226,7 @@ public class FHIRToolingClient {
getPreferredResourceFormat(),
generateHeaders(),
"Read " + resourceClass.getName() + "?url=" + canonicalURL,
TIMEOUT_NORMAL);
timeoutNormal);
if (result.isUnsuccessfulRequest()) {
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload());
}
@ -254,7 +249,7 @@ public class FHIRToolingClient {
getPreferredResourceFormat(),
generateHeaders(),
"Update " + resource.fhirType() + "/" + resource.getId(),
TIMEOUT_OPERATION);
timeoutOperation);
if (result.isUnsuccessfulRequest()) {
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload());
}
@ -281,7 +276,7 @@ public class FHIRToolingClient {
getPreferredResourceFormat(),
generateHeaders(),
"Update " + resource.fhirType() + "/" + id,
TIMEOUT_OPERATION);
timeoutOperation);
if (result.isUnsuccessfulRequest()) {
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload());
}
@ -318,12 +313,12 @@ public class FHIRToolingClient {
client.getLogger().logRequest("POST", url.toString(), null, body);
}
result = client.issuePostRequest(url, body, getPreferredResourceFormat(), generateHeaders(),
"POST " + resourceClass.getName() + "/$" + name, TIMEOUT_OPERATION_LONG);
"POST " + resourceClass.getName() + "/$" + name, timeoutLong);
} else {
if (client.getLogger() != null) {
client.getLogger().logRequest("GET", url.toString(), null, null);
}
result = client.issueGetResourceRequest(url, getPreferredResourceFormat(), generateHeaders(), "GET " + resourceClass.getName() + "/$" + name, TIMEOUT_OPERATION_LONG);
result = client.issueGetResourceRequest(url, getPreferredResourceFormat(), generateHeaders(), "GET " + resourceClass.getName() + "/$" + name, timeoutLong);
}
if (result.isUnsuccessfulRequest()) {
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload());
@ -345,7 +340,7 @@ public class FHIRToolingClient {
public Bundle transaction(Bundle batch) {
Bundle transactionResult = null;
try {
transactionResult = client.postBatchRequest(resourceAddress.getBaseServiceUri(), ByteUtils.resourceToByteArray(batch, false, isJson(getPreferredResourceFormat())), getPreferredResourceFormat(), "transaction", TIMEOUT_OPERATION + (TIMEOUT_ENTRY * batch.getEntry().size()));
transactionResult = client.postBatchRequest(resourceAddress.getBaseServiceUri(), ByteUtils.resourceToByteArray(batch, false, isJson(getPreferredResourceFormat())), getPreferredResourceFormat(), "transaction", timeoutOperation + (timeoutEntry * batch.getEntry().size()));
} catch (Exception e) {
handleException("An error occurred trying to process this transaction request", e);
}
@ -359,7 +354,7 @@ public class FHIRToolingClient {
result = client.issuePostRequest(resourceAddress.resolveValidateUri(resourceClass, id),
ByteUtils.resourceToByteArray(resource, false, isJson(getPreferredResourceFormat())),
getPreferredResourceFormat(), generateHeaders(),
"POST " + resourceClass.getName() + (id != null ? "/" + id : "") + "/$validate", TIMEOUT_OPERATION_LONG);
"POST " + resourceClass.getName() + (id != null ? "/" + id : "") + "/$validate", timeoutLong);
if (result.isUnsuccessfulRequest()) {
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload());
}
@ -418,7 +413,7 @@ public class FHIRToolingClient {
getPreferredResourceFormat(),
generateHeaders(),
"ValueSet/$expand?url=" + source.getUrl(),
TIMEOUT_OPERATION_EXPAND);
timeoutExpand);
if (result.isUnsuccessfulRequest()) {
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload());
}
@ -436,7 +431,7 @@ public class FHIRToolingClient {
getPreferredResourceFormat(),
generateHeaders(),
"CodeSystem/$lookup",
TIMEOUT_NORMAL);
timeoutNormal);
} catch (IOException e) {
e.printStackTrace();
}
@ -459,7 +454,7 @@ public class FHIRToolingClient {
getPreferredResourceFormat(),
generateHeaders(),
"ValueSet/$expand?url=" + source.getUrl(),
TIMEOUT_OPERATION_EXPAND);
timeoutExpand);
if (result.isUnsuccessfulRequest()) {
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload());
}
@ -483,7 +478,7 @@ public class FHIRToolingClient {
getPreferredResourceFormat(),
generateHeaders(),
"ValueSet/$expand?url=" + source.getUrl(),
TIMEOUT_OPERATION_EXPAND);
timeoutExpand);
if (result.isUnsuccessfulRequest()) {
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload());
}
@ -507,7 +502,7 @@ public class FHIRToolingClient {
getPreferredResourceFormat(),
generateHeaders(),
"Closure?name=" + name,
TIMEOUT_NORMAL);
timeoutNormal);
if (result.isUnsuccessfulRequest()) {
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload());
}
@ -528,7 +523,7 @@ public class FHIRToolingClient {
getPreferredResourceFormat(),
generateHeaders(),
"UpdateClosure?name=" + name,
TIMEOUT_OPERATION);
timeoutOperation);
if (result.isUnsuccessfulRequest()) {
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload());
}

View File

@ -0,0 +1,431 @@
package org.hl7.fhir.r4.ips;
import java.util.Date;
import java.util.List;
import org.hl7.fhir.r4.ips.IPSBuilder.TypeAndId;
import org.hl7.fhir.r4.model.Age;
import org.hl7.fhir.r4.model.Annotation;
import org.hl7.fhir.r4.model.Bundle;
import org.hl7.fhir.r4.model.Bundle.BundleEntryComponent;
import org.hl7.fhir.r4.model.Bundle.BundleType;
import org.hl7.fhir.r4.model.CodeableConcept;
import org.hl7.fhir.r4.model.Coding;
import org.hl7.fhir.r4.model.Composition;
import org.hl7.fhir.r4.model.Patient;
import org.hl7.fhir.r4.model.Period;
import org.hl7.fhir.r4.model.Quantity;
import org.hl7.fhir.r4.model.Range;
import org.hl7.fhir.r4.model.Reference;
import org.hl7.fhir.r4.model.Type;
import org.hl7.fhir.r4.model.Composition.CompositionStatus;
import org.hl7.fhir.r4.model.Composition.SectionComponent;
import org.hl7.fhir.r4.model.Condition;
import org.hl7.fhir.r4.model.Device;
import org.hl7.fhir.r4.model.DomainResource;
import org.hl7.fhir.r4.model.Dosage;
import org.hl7.fhir.r4.model.Identifier;
import org.hl7.fhir.r4.model.Medication;
import org.hl7.fhir.r4.model.MedicationStatement;
import org.hl7.fhir.r4.model.Narrative.NarrativeStatus;
import org.hl7.fhir.r4.utils.client.FHIRToolingClient;
import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.utilities.VersionUtil;
import org.hl7.fhir.utilities.xhtml.XhtmlNode;
public class IPSBuilder {
public static class TypeAndId {
private String type;
private String id;
protected TypeAndId(String type, String id) {
super();
this.type = type;
this.id = id;
}
public String getType() {
return type;
}
public String getId() {
return id;
}
}
public static Bundle generateIPS(FHIRToolingClient server, String patientId) {
Patient pat = server.fetchResource(Patient.class, patientId);
Bundle bnd = initBundle();
Composition cmp = initComposition(bnd, server.getAddress(), pat);
pat = processPatient(bnd, server.getAddress(), pat);
// addMedications(bnd, cmp, server, patientId);
addConditions(bnd, cmp, server, patientId);
return bnd;
}
private static Bundle initBundle() {
Bundle bnd = new Bundle();
bnd.getIdentifier().setSystem("urn:ietf:rfc:3986");
bnd.getIdentifier().setValue(Utilities.makeUuidUrn());
bnd.setType(BundleType.DOCUMENT);
bnd.setTimestamp(new Date());
return bnd;
}
private static Composition initComposition(Bundle bnd, String url, Patient pat) {
Composition cmp = new Composition();
cmp.setIdBase(Utilities.makeUuidLC());
cmp.setStatus(CompositionStatus.FINAL);
cmp.getType().addCoding().setSystem("http://loinc.org").setCode("60591-5");
cmp.setDate(new Date());
cmp.setTitle("International Patient Summary");
cmp.getSubject().setReference("Patient/"+pat.getIdBase());
cmp.addAuthor().setReference("Device/java");
bnd.addEntry().setResource(cmp).setFullUrl(Utilities.pathURL(url, "Composition", cmp.getIdBase()));
Device dev = new Device();
dev.setId("java");
dev.addDeviceName().setName("Java Core Library");
dev.addVersion().setValue(VersionUtil.getVersion());
bnd.addEntry().setResource(dev).setFullUrl(Utilities.pathURL(url, "Device", dev.getIdBase()));
return cmp;
}
private static Patient processPatient(Bundle bnd, String url, Patient pat) {
bnd.addEntry().setResource(pat).setFullUrl(Utilities.pathURL(url, "Patient", pat.getIdBase()));
return pat;
}
private static void addMedications(Bundle bnd, Composition cmp, FHIRToolingClient server, String patientId) {
Bundle sb = server.search("MedicationStatement", "?patient="+patientId+"&_include=MedicationStatement:medication&_include=MedicationStatement:source");
SectionComponent sct = cmp.addSection();
sct.setTitle("Medications");
sct.getCode().addCoding().setSystem("http://loinc.org").setCode("10160-0");
sct.getText().setStatus(NarrativeStatus.GENERATED);
var x = sct.getText().getDiv();
var tbl = x.table("grid");
var tr = tbl.tr();
tr.th().tx("Medication");
tr.th().tx("Category");
tr.th().tx("Status");
tr.th().tx("When");
tr.th().tx("Dosage");
tr.th().tx("Reason");
tr.th().tx("Source");
tr.th().tx("Notes");
boolean ok = false;
for (BundleEntryComponent be : sb.getEntry()) {
if (be.hasResource() && be.getResource() instanceof MedicationStatement) {
MedicationStatement mdstmt = (MedicationStatement) be.getResource();
ok = true;
bnd.addEntry().setResource(mdstmt).setFullUrl(Utilities.pathURL(server.getAddress(), "MedicationStatement", mdstmt.getIdBase()));
sct.addEntry().setReference("MedicationStatement/"+mdstmt.getIdBase());
tr = tbl.tr();
if (mdstmt.hasMedicationReference()) {
Medication med = findMedication(sb, server, mdstmt, mdstmt.getMedicationReference());
if (med == null) {
tr.td().b().tx("Unknown?");
} else {
tr.td().tx(summarise(med));
bnd.addEntry().setResource(med).setFullUrl(Utilities.pathURL(server.getAddress(), "Medication", med.getIdBase()));
}
} else {
tr.td().tx(genCC(mdstmt.getMedicationCodeableConcept()));
}
tr.td().tx(genCC(mdstmt.getCategory()));
var td = tr.td();
td.tx(mdstmt.getStatus().getDisplay());
if (mdstmt.hasStatusReason()) {
td.tx(" (");
td.tx(genCC(mdstmt.getStatusReason()));
td.tx(")");
}
tr.td().tx(genDT(mdstmt.getEffective()));
genDosages(tr.td(), mdstmt.getDosage());
tr.td().tx(genReference(mdstmt, mdstmt.getInformationSource(), bnd, sb, server));
genNotes(tr.td(), mdstmt.getNote());
}
}
if (!ok) {
Condition cnd = new Condition();
cnd.setId(Utilities.makeUuidLC());
cnd.getText().setStatus(NarrativeStatus.GENERATED);
var rx = cnd.getText().getDiv();
rx.tx("No information is provided about the patient's medical problems");
tr = tbl.tr();
tr.td().colspan(7).tx("No information is provided about the patient's medical problems");
cnd.getClinicalStatus().addCoding().setSystem("http://terminology.hl7.org/CodeSystem/condition-clinical").setCode("active").setDisplay("Active");
cnd.getCode().addCoding().setSystem("http://hl7.org/fhir/uv/ips/CodeSystem/absent-unknown-uv-ips").setCode("no-problem-info").setDisplay("No information about current problems");
cnd.getSubject().setReference("Patient/"+patientId);
}
}
private static void genDosages(XhtmlNode x, List<Dosage> dosages) {
if (dosages == null || dosages.size() == 0) {
} else if (dosages.size() == 1) {
genDosage(x, dosages.get(0));
} else {
var ul = x.ul();
for (Dosage d : dosages) {
genDosage(ul.li(), d);
}
}
}
private static void genDosage(XhtmlNode x, Dosage dosage) {
x.tx(dosage.getText());
if (dosage.hasAsNeeded()) {
x.nbsp();
if (dosage.hasAsNeededBooleanType()) {
if (dosage.getAsNeededBooleanType().booleanValue()) {
x.tx(" (as needed)");
}
} else {
x.tx(genDT(dosage.getAsNeeded()));
}
} else if (dosage.hasTiming()) {
x.nbsp();
x.tx(genDT(dosage.getTiming()));
}
if (dosage.hasSite()) {
x.tx(". ");
x.tx(genDT(dosage.getSite()));
}
if (dosage.hasRoute()) {
x.tx(". ");
x.tx(genDT(dosage.getRoute()));
}
}
private static Medication findMedication(Bundle sb, FHIRToolingClient server, MedicationStatement mdstmt, Reference ref) {
if (ref == null || !ref.hasReference()) {
return null;
}
if (ref.getReference().startsWith("#")) {
} else {
}
return null;
}
private static void addConditions(Bundle bnd, Composition cmp, FHIRToolingClient server, String patientId) {
Bundle sb = server.search("Condition", "?patient="+patientId+"&_include=Condition:asserter");
SectionComponent sct = cmp.addSection();
sct.setTitle("Problems");
sct.getCode().addCoding().setSystem("http://loinc.org").setCode("11450-4");
sct.getText().setStatus(NarrativeStatus.GENERATED);
var x = sct.getText().getDiv();
var tbl = x.table("grid");
var tr = tbl.tr();
tr.th().tx("Code");
tr.th().tx("Category");
tr.th().tx("Severity");
tr.th().tx("Status");
tr.th().tx("Onset");
tr.th().tx("Abatement");
tr.th().tx("Source");
tr.th().tx("Notes");
boolean ok = false;
for (BundleEntryComponent be : sb.getEntry()) {
if (be.hasResource() && be.getResource() instanceof Condition) {
Condition cnd = (Condition) be.getResource();
ok = true;
bnd.addEntry().setResource(cnd).setFullUrl(Utilities.pathURL(server.getAddress(), "Condition", cnd.getIdBase()));
sct.addEntry().setReference("Condition/"+cnd.getIdBase());
tr = tbl.tr();
tr.td().tx(genCC(cnd.getCode()));
tr.td().tx(genCC(cnd.getCategory()));
tr.td().tx(genCC(cnd.getSeverity()));
tr.td().tx(genStatus(cnd));
tr.td().tx(genDT(cnd.getOnset()));
tr.td().tx(genDT(cnd.getAbatement()));
tr.td().tx(genSource(cnd, bnd, sb, server));
genNotes(tr.td(), cnd.getNote());
}
}
if (!ok) {
Condition cnd = new Condition();
cnd.setId(Utilities.makeUuidLC());
cnd.getText().setStatus(NarrativeStatus.GENERATED);
var rx = cnd.getText().getDiv();
rx.tx("No information is provided about the patient's medical problems");
tr = tbl.tr();
tr.td().colspan(7).tx("No information is provided about the patient's medical problems");
cnd.getClinicalStatus().addCoding().setSystem("http://terminology.hl7.org/CodeSystem/condition-clinical").setCode("active").setDisplay("Active");
cnd.getCode().addCoding().setSystem("http://hl7.org/fhir/uv/ips/CodeSystem/absent-unknown-uv-ips").setCode("no-problem-info").setDisplay("No information about current problems");
cnd.getSubject().setReference("Patient/"+patientId);
}
}
private static String genReference(DomainResource src, Reference ref, Bundle bnd, Bundle search, FHIRToolingClient server) {
if (ref == null || ref.isEmpty()) {
return null;
}
boolean contained = false;
DomainResource tgt = null;
if (ref.hasReference()) {
if (ref.getReference().startsWith("#")) {
tgt = (DomainResource) src.getContained(ref.getReference());
contained = true;
} else {
TypeAndId tid = getTypeAndId(server.getAddress(), ref.getReference());
if (tid != null) {
tgt = findInBundle(bnd, Utilities.pathURL(server.getAddress(), tid.getType(), tid.getId()));
if (tgt == null) {
tgt = findInBundle(search, Utilities.pathURL(server.getAddress(), tid.getType(), tid.getId()));
if (tgt == null) {
tgt = (DomainResource) server.read(tid.getType(), tid.getId());
}
} else {
contained = true;
}
}
}
}
if (tgt != null) {
if (!contained) {
bnd.addEntry().setResource(tgt).setFullUrl(Utilities.pathURL(server.getAddress(), tgt.fhirType(), tgt.getIdBase()));
}
return summarise(tgt);
} else if (ref.hasDisplay()) {
return ref.getDisplay();
} else if (ref.hasReference()) {
return ref.getReference();
} else if (ref.hasIdentifier()) {
return genIdentifier(ref.getIdentifier());
} else {
return "unknown";
}
}
private static TypeAndId getTypeAndId(String baseUrl, String url) {
if (Utilities.noString(url)) {
return null;
}
if (url.startsWith(baseUrl+"/")) {
url = url.substring(baseUrl.length()+1);
}
String[] p = url.split("\\/");
if (p.length > 1) {
if ("_history".equals(p[p.length-2]) && p.length > 3) {
return new TypeAndId(p[p.length-4], p[p.length-3]);
} else {
return new TypeAndId(p[p.length-2], p[p.length-1]);
}
}
return null;
}
private static DomainResource findInBundle(Bundle bnd, String url) {
for (BundleEntryComponent be : bnd.getEntry()) {
if (url.equals(be.getFullUrl()) && be.hasResource() && be.getResource() instanceof DomainResource) {
return (DomainResource) be.getResource();
}
}
return null;
}
private static String summarise(DomainResource tgt) {
// TODO Auto-generated method stub
return null;
}
private static String genIdentifier(Identifier id) {
return id.getValue();
}
private static void genNotes(XhtmlNode td, List<Annotation> notes) {
if (notes.size() > 0) {
if (notes.size() == 1) {
genNote(td, notes.get(0));
} else {
var ul = td.ul();
for (Annotation a : notes) {
genNote(ul.li(), a);
}
}
}
}
private static void genNote(XhtmlNode td, Annotation annotation) {
td.tx(annotation.getText());
}
private static String genSource(Condition cnd, Bundle bnd, Bundle sb, FHIRToolingClient server) {
if (cnd.hasAsserter()) {
return genReference(cnd, cnd.getAsserter(), bnd, sb, server);
} else if (cnd.hasRecorder()) {
return genReference(cnd, cnd.getRecorder(), bnd, sb, server);
} else {
return null;
}
}
private static String genDT(Type v) {
if (v == null) {
return null;
}
if (v.isPrimitive()) {
return v.primitiveValue();
}
if (v instanceof Age) {
return genQty((Age) v);
}
if (v instanceof Period) {
Period p = (Period) v;
return genDT(p.getStartElement())+" - "+genDT(p.getStartElement());
}
if (v instanceof Range) {
Range p = (Range) v;
return genDT(p.getLow())+" - "+genDT(p.getHigh());
}
return "not done: "+v.fhirType();
}
private static String genQty(Quantity v) {
return v.getValue().toPlainString()+v.getUnit();
}
private static String genStatus(Condition cnd) {
if (cnd.hasClinicalStatus() && cnd.hasVerificationStatus()) {
return genCC(cnd.getClinicalStatus()) +"/"+genCC(cnd.getVerificationStatus());
} else if (cnd.hasClinicalStatus()) {
return genCC(cnd.getClinicalStatus());
} else if (cnd.hasVerificationStatus()) {
return genCC(cnd.getVerificationStatus());
} else {
return null;
}
}
private static String genCC(List<CodeableConcept> list) {
if (list != null && list.size() == 1) {
return genCC(list.get(0));
} else {
return null;
}
}
private static String genCC(CodeableConcept code) {
if (code.hasText()) {
return code.getText();
} else if (code.hasCoding()) {
Coding c = code.getCodingFirstRep();
if (c.hasDisplay()) {
return c.getDisplay();
} else {
return c.getCode();
}
} else {
return null;
}
}
}

View File

@ -579,6 +579,15 @@ public abstract class DomainResource extends Resource
}
}
public Resource getContained(String reference) {
for (Resource c : getContained()) {
if (reference.equals("#"+c.getId())) {
return c;
}
}
return null;
}
// end addition
}

View File

@ -62,7 +62,7 @@ public enum Hl7WorkGroup {
DEV,
/**
* Electronic Health Records
* (http://www.hl7.org/special/committees/ehr/index.cfm).
* (http://www.hl7.org/Special/committees/ehr/index.cfm).
*/
EHR,
/**
@ -85,12 +85,12 @@ public enum Hl7WorkGroup {
II,
/**
* Infrastructure And Messaging
* (http://www.hl7.org/special/committees/inm/index.cfm).
* (http://www.hl7.org/Special/committees/inm/index.cfm).
*/
INM,
/**
* Implementable Technology Specifications
* (http://www.hl7.org/special/committees/xml/index.cfm).
* (http://www.hl7.org/Special/committees/xml/index.cfm).
*/
ITS,
/**
@ -281,7 +281,7 @@ public enum Hl7WorkGroup {
case DEV:
return "Health Care Devices (http://www.hl7.org/Special/committees/healthcaredevices/index.cfm).";
case EHR:
return "Electronic Health Records (http://www.hl7.org/special/committees/ehr/index.cfm).";
return "Electronic Health Records (http://www.hl7.org/Special/committees/ehr/index.cfm).";
case FHIR:
return "FHIR Infrastructure (http://www.hl7.org/Special/committees/fiwg/index.cfm).";
case FM:
@ -291,9 +291,9 @@ public enum Hl7WorkGroup {
case II:
return "Imaging Integration (http://www.hl7.org/Special/committees/imagemgt/index.cfm).";
case INM:
return "Infrastructure And Messaging (http://www.hl7.org/special/committees/inm/index.cfm).";
return "Infrastructure And Messaging (http://www.hl7.org/Special/committees/inm/index.cfm).";
case ITS:
return "Implementable Technology Specifications (http://www.hl7.org/special/committees/xml/index.cfm).";
return "Implementable Technology Specifications (http://www.hl7.org/Special/committees/xml/index.cfm).";
case MNM:
return "Modeling and Methodology (http://www.hl7.org/Special/committees/mnm/index.cfm).";
case OO:

View File

@ -87,7 +87,7 @@ public class TerminologyClientR4 implements TerminologyClient {
@Override
public void setTimeout(int i) {
client.setTimeout(i);
client.setTimeoutNormal(i); // #FIXME
}
@Override

View File

@ -3338,9 +3338,11 @@ public class FHIRPathEngine {
}
case Iif: {
TypeDetails types = new TypeDetails(null);
types.update(paramTypes.get(0));
if (paramTypes.size() > 1) {
types.update(paramTypes.get(1));
checkSingleton(focus, "iif", exp);
checkParamTypes(exp, exp.getFunction().toCode(), paramTypes, new TypeDetails(CollectionStatus.SINGLETON, TypeDetails.FP_Boolean));
types.update(paramTypes.get(1));
if (paramTypes.size() > 2) {
types.update(paramTypes.get(2));
}
return types;
}
@ -3646,6 +3648,12 @@ public class FHIRPathEngine {
}
}
private void checkSingleton(TypeDetails focus, String name, ExpressionNode expr) throws PathEngineException {
if (focus.getCollectionStatus() != CollectionStatus.SINGLETON) {
// typeWarnings.add(new IssueMessage(worker.formatMessage(I18nConstants.FHIRPATH_COLLECTION_STATUS_CONTEXT, name, expr.toString()), I18nConstants.FHIRPATH_COLLECTION_STATUS_CONTEXT));
}
}
private void checkOrdered(TypeDetails focus, String name, ExpressionNode expr) throws PathEngineException {
if (focus.getCollectionStatus() == CollectionStatus.UNORDERED) {
throw makeException(expr, I18nConstants.FHIRPATH_ORDERED_ONLY, name);
@ -4806,9 +4814,12 @@ public class FHIRPathEngine {
}
private List<Base> funcIif(ExecutionContext context, List<Base> focus, ExpressionNode exp) throws FHIRException {
List<Base> n1 = execute(context, focus, exp.getParameters().get(0), true);
if (focus.size() > 1) {
throw makeException(exp, I18nConstants.FHIRPATH_NO_COLLECTION, "iif", focus.size());
}
List<Base> n1 = execute(focus.isEmpty() ? context : changeThis(context, focus.get(0)), focus, exp.getParameters().get(0), true);
Equality v = asBool(n1, exp);
if (v == Equality.True) {
return execute(context, focus, exp.getParameters().get(1), true);
} else if (exp.getParameters().size() < 3) {
@ -4817,7 +4828,7 @@ public class FHIRPathEngine {
return execute(context, focus, exp.getParameters().get(2), true);
}
}
private List<Base> funcTake(ExecutionContext context, List<Base> focus, ExpressionNode exp) throws FHIRException {
List<Base> n1 = execute(context, focus, exp.getParameters().get(0), true);
int i1 = Integer.parseInt(n1.get(0).primitiveValue());
@ -4849,7 +4860,7 @@ public class FHIRPathEngine {
for (Base item : focus) {
result.add(item);
}
for (Base item : execute(context, focus, exp.getParameters().get(0), true)) {
for (Base item : execute(context, baseToList(context.thisItem), exp.getParameters().get(0), true)) {
result.add(item);
}
return result;

View File

@ -25,6 +25,7 @@ import org.hl7.fhir.r4.model.ValueSet;
import org.hl7.fhir.r4.utils.client.network.ByteUtils;
import org.hl7.fhir.r4.utils.client.network.Client;
import org.hl7.fhir.r4.utils.client.network.ResourceRequest;
import org.hl7.fhir.utilities.FHIRBaseToolingClient;
import org.hl7.fhir.utilities.ToolingClientLogger;
import org.hl7.fhir.utilities.Utilities;
@ -60,19 +61,13 @@ import okhttp3.internal.http2.Header;
*
* @author Claude Nanjo
*/
public class FHIRToolingClient {
public class FHIRToolingClient extends FHIRBaseToolingClient {
public static final String DATETIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ssK";
public static final String DATE_FORMAT = "yyyy-MM-dd";
public static final String hostKey = "http.proxyHost";
public static final String portKey = "http.proxyPort";
private static final int TIMEOUT_NORMAL = 1500;
private static final int TIMEOUT_OPERATION = 30000;
private static final int TIMEOUT_ENTRY = 500;
private static final int TIMEOUT_OPERATION_LONG = 60000;
private static final int TIMEOUT_OPERATION_EXPAND = 120000;
private String base;
private ResourceAddress resourceAddress;
private ResourceFormat preferredResourceFormat;
@ -134,7 +129,7 @@ public class FHIRToolingClient {
TerminologyCapabilities capabilities = null;
try {
capabilities = (TerminologyCapabilities) client.issueGetResourceRequest(resourceAddress.resolveMetadataTxCaps(),
getPreferredResourceFormat(), generateHeaders(), "TerminologyCapabilities", TIMEOUT_NORMAL).getReference();
getPreferredResourceFormat(), generateHeaders(), "TerminologyCapabilities", timeoutNormal).getReference();
} catch (Exception e) {
throw new FHIRException("Error fetching the server's terminology capabilities", e);
}
@ -145,7 +140,7 @@ public class FHIRToolingClient {
CapabilityStatement conformance = null;
try {
conformance = (CapabilityStatement) client.issueGetResourceRequest(resourceAddress.resolveMetadataUri(false),
getPreferredResourceFormat(), generateHeaders(), "CapabilitiesStatement", TIMEOUT_NORMAL).getReference();
getPreferredResourceFormat(), generateHeaders(), "CapabilitiesStatement", timeoutNormal).getReference();
} catch (Exception e) {
throw new FHIRException("Error fetching the server's conformance statement", e);
}
@ -157,7 +152,7 @@ public class FHIRToolingClient {
return capabilities;
try {
capabilities = (CapabilityStatement) client.issueGetResourceRequest(resourceAddress.resolveMetadataUri(true),
getPreferredResourceFormat(), generateHeaders(), "CapabilitiesStatement-Quick", TIMEOUT_NORMAL)
getPreferredResourceFormat(), generateHeaders(), "CapabilitiesStatement-Quick", timeoutNormal)
.getReference();
} catch (Exception e) {
throw new FHIRException("Error fetching the server's capability statement: " + e.getMessage(), e);
@ -165,12 +160,28 @@ public class FHIRToolingClient {
return capabilities;
}
public Resource read(String resourceClass, String id) {// TODO Change this to AddressableResource
ResourceRequest<Resource> result = null;
try {
result = client.issueGetResourceRequest(resourceAddress.resolveGetUriFromResourceClassAndId(resourceClass, id),
getPreferredResourceFormat(), generateHeaders(), "Read " + resourceClass + "/" + id,
timeoutNormal);
if (result.isUnsuccessfulRequest()) {
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(),
(OperationOutcome) result.getPayload());
}
} catch (Exception e) {
throw new FHIRException(e);
}
return result.getPayload();
}
public <T extends Resource> T read(Class<T> resourceClass, String id) {// TODO Change this to AddressableResource
ResourceRequest<T> result = null;
try {
result = client.issueGetResourceRequest(resourceAddress.resolveGetUriFromResourceClassAndId(resourceClass, id),
getPreferredResourceFormat(), generateHeaders(), "Read " + resourceClass.getName() + "/" + id,
TIMEOUT_NORMAL);
timeoutNormal);
if (result.isUnsuccessfulRequest()) {
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(),
(OperationOutcome) result.getPayload());
@ -187,7 +198,7 @@ public class FHIRToolingClient {
result = client.issueGetResourceRequest(
resourceAddress.resolveGetUriFromResourceClassAndIdAndVersion(resourceClass, id, version),
getPreferredResourceFormat(), generateHeaders(),
"VRead " + resourceClass.getName() + "/" + id + "/?_history/" + version, TIMEOUT_NORMAL);
"VRead " + resourceClass.getName() + "/" + id + "/?_history/" + version, timeoutNormal);
if (result.isUnsuccessfulRequest()) {
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(),
(OperationOutcome) result.getPayload());
@ -204,7 +215,7 @@ public class FHIRToolingClient {
result = client.issueGetResourceRequest(
resourceAddress.resolveGetUriFromResourceClassAndCanonical(resourceClass, canonicalURL),
getPreferredResourceFormat(), generateHeaders(), "Read " + resourceClass.getName() + "?url=" + canonicalURL,
TIMEOUT_NORMAL);
timeoutNormal);
if (result.isUnsuccessfulRequest()) {
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(),
(OperationOutcome) result.getPayload());
@ -227,7 +238,7 @@ public class FHIRToolingClient {
resourceAddress.resolveGetUriFromResourceClassAndId(resource.getClass(), resource.getId()),
ByteUtils.resourceToByteArray(resource, false, isJson(getPreferredResourceFormat())),
getPreferredResourceFormat(), generateHeaders(), "Update " + resource.fhirType() + "/" + resource.getId(),
TIMEOUT_OPERATION);
timeoutOperation);
if (result.isUnsuccessfulRequest()) {
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(),
(OperationOutcome) result.getPayload());
@ -256,7 +267,7 @@ public class FHIRToolingClient {
result = client.issuePutRequest(resourceAddress.resolveGetUriFromResourceClassAndId(resourceClass, id),
ByteUtils.resourceToByteArray(resource, false, isJson(getPreferredResourceFormat())),
getPreferredResourceFormat(), generateHeaders(), "Update " + resource.fhirType() + "/" + id,
TIMEOUT_OPERATION);
timeoutOperation);
if (result.isUnsuccessfulRequest()) {
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(),
(OperationOutcome) result.getPayload());
@ -293,10 +304,10 @@ public class FHIRToolingClient {
if (complex) {
byte[] body = ByteUtils.resourceToByteArray(params, false, isJson(getPreferredResourceFormat()));
result = client.issuePostRequest(url, body, getPreferredResourceFormat(), generateHeaders(),
"POST " + resourceClass.getName() + "/$" + name, TIMEOUT_OPERATION_LONG);
"POST " + resourceClass.getName() + "/$" + name, timeoutLong);
} else {
result = client.issueGetResourceRequest(url, getPreferredResourceFormat(), generateHeaders(),
"GET " + resourceClass.getName() + "/$" + name, TIMEOUT_OPERATION_LONG);
"GET " + resourceClass.getName() + "/$" + name, timeoutLong);
}
if (result.isUnsuccessfulRequest()) {
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(),
@ -316,7 +327,7 @@ public class FHIRToolingClient {
try {
transactionResult = client.postBatchRequest(resourceAddress.getBaseServiceUri(),
ByteUtils.resourceToByteArray(batch, false, isJson(getPreferredResourceFormat())),
getPreferredResourceFormat(), "transaction", TIMEOUT_OPERATION + (TIMEOUT_ENTRY * batch.getEntry().size()));
getPreferredResourceFormat(), "transaction", timeoutOperation + (timeoutEntry * batch.getEntry().size()));
} catch (Exception e) {
handleException("An error occurred trying to process this transaction request", e);
}
@ -330,7 +341,7 @@ public class FHIRToolingClient {
result = client.issuePostRequest(resourceAddress.resolveValidateUri(resourceClass, id),
ByteUtils.resourceToByteArray(resource, false, isJson(getPreferredResourceFormat())),
getPreferredResourceFormat(), generateHeaders(),
"POST " + resourceClass.getName() + (id != null ? "/" + id : "") + "/$validate", TIMEOUT_OPERATION_LONG);
"POST " + resourceClass.getName() + (id != null ? "/" + id : "") + "/$validate", timeoutLong);
if (result.isUnsuccessfulRequest()) {
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(),
(OperationOutcome) result.getPayload());
@ -373,7 +384,7 @@ public class FHIRToolingClient {
public Bundle fetchFeed(String url) {
Bundle feed = null;
try {
feed = client.issueGetFeedRequest(new URI(url), getPreferredResourceFormat());
feed = client.issueGetFeedRequest(new URI(url), getPreferredResourceFormat(), timeoutLong);
} catch (Exception e) {
handleException("An error has occurred while trying to retrieve history since last update", e);
}
@ -398,7 +409,7 @@ public class FHIRToolingClient {
org.hl7.fhir.r4.utils.client.network.ResourceRequest<Resource> result = null;
try {
result = client.issueGetResourceRequest(resourceAddress.resolveOperationUri(ValueSet.class, "expand", parameters),
getPreferredResourceFormat(), generateHeaders(), "ValueSet/$expand?url=" + vsUrl, TIMEOUT_OPERATION_EXPAND);
getPreferredResourceFormat(), generateHeaders(), "ValueSet/$expand?url=" + vsUrl, timeoutExpand);
} catch (IOException e) {
throw new FHIRException(e);
}
@ -416,7 +427,7 @@ public class FHIRToolingClient {
try {
result = client.issuePostRequest(resourceAddress.resolveOperationUri(ValueSet.class, "expand"),
ByteUtils.resourceToByteArray(p, false, isJson(getPreferredResourceFormat())), getPreferredResourceFormat(),
generateHeaders(), "ValueSet/$expand?url=" + source.getUrl(), TIMEOUT_OPERATION_EXPAND);
generateHeaders(), "ValueSet/$expand?url=" + source.getUrl(), timeoutExpand);
if (result.isUnsuccessfulRequest()) {
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(),
(OperationOutcome) result.getPayload());
@ -431,7 +442,7 @@ public class FHIRToolingClient {
org.hl7.fhir.r4.utils.client.network.ResourceRequest<Resource> result = null;
try {
result = client.issueGetResourceRequest(resourceAddress.resolveOperationUri(CodeSystem.class, "lookup", params),
getPreferredResourceFormat(), generateHeaders(), "CodeSystem/$lookup", TIMEOUT_NORMAL);
getPreferredResourceFormat(), generateHeaders(), "CodeSystem/$lookup", timeoutNormal);
} catch (IOException e) {
throw new FHIRException(e);
}
@ -455,7 +466,7 @@ public class FHIRToolingClient {
result = client.issuePostRequest(resourceAddress.resolveOperationUri(ValueSet.class, "expand", params),
ByteUtils.resourceToByteArray(p, false, isJson(getPreferredResourceFormat())), getPreferredResourceFormat(),
generateHeaders(), source == null ? "ValueSet/$expand" : "ValueSet/$expand?url=" + source.getUrl(),
TIMEOUT_OPERATION_EXPAND);
timeoutExpand);
if (result.isUnsuccessfulRequest()) {
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(),
(OperationOutcome) result.getPayload());
@ -484,7 +495,7 @@ public class FHIRToolingClient {
result = client.issuePostRequest(
resourceAddress.resolveOperationUri(null, "closure", new HashMap<String, String>()),
ByteUtils.resourceToByteArray(params, false, isJson(getPreferredResourceFormat())),
getPreferredResourceFormat(), generateHeaders(), "Closure?name=" + name, TIMEOUT_NORMAL);
getPreferredResourceFormat(), generateHeaders(), "Closure?name=" + name, timeoutNormal);
if (result.isUnsuccessfulRequest()) {
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(),
(OperationOutcome) result.getPayload());
@ -504,7 +515,7 @@ public class FHIRToolingClient {
result = client.issuePostRequest(
resourceAddress.resolveOperationUri(null, "closure", new HashMap<String, String>()),
ByteUtils.resourceToByteArray(params, false, isJson(getPreferredResourceFormat())),
getPreferredResourceFormat(), generateHeaders(), "UpdateClosure?name=" + name, TIMEOUT_OPERATION);
getPreferredResourceFormat(), generateHeaders(), "UpdateClosure?name=" + name, timeoutOperation);
if (result.isUnsuccessfulRequest()) {
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(),
(OperationOutcome) result.getPayload());
@ -531,14 +542,6 @@ public class FHIRToolingClient {
this.password = password;
}
public long getTimeout() {
return client.getTimeout();
}
public void setTimeout(long timeout) {
client.setTimeout(timeout);
}
public ToolingClientLogger getLogger() {
return client.getLogger();
}
@ -615,7 +618,7 @@ public class FHIRToolingClient {
org.hl7.fhir.r4.utils.client.network.ResourceRequest<Resource> result = null;
try {
result = client.issueGetResourceRequest(resourceAddress.resolveGetResource(resourceClass, id),
getPreferredResourceFormat(), generateHeaders(), resourceClass.getName()+"/"+id, TIMEOUT_NORMAL);
getPreferredResourceFormat(), generateHeaders(), resourceClass.getName()+"/"+id, timeoutNormal);
} catch (IOException e) {
throw new FHIRException(e);
}
@ -625,4 +628,6 @@ public class FHIRToolingClient {
}
return (T) result.getPayload();
}
}

View File

@ -113,6 +113,10 @@ public class ResourceAddress {
return baseServiceUri.resolve(nameForClass(resourceClass) + "/" + id);
}
public URI resolveGetUriFromResourceClassAndId(String resourceClass, String id) {
return baseServiceUri.resolve(resourceClass + "/" + id);
}
public <T extends Resource> URI resolveGetUriFromResourceClassAndIdAndVersion(Class<T> resourceClass, String id,
String version) {
return baseServiceUri.resolve(nameForClass(resourceClass) + "/" + id + "/_history/" + version);

View File

@ -16,13 +16,13 @@ import okhttp3.Request;
import okhttp3.RequestBody;
public class Client {
public static final String DEFAULT_CHARSET = "UTF-8";
private static final long DEFAULT_TIMEOUT = 5000;
private ToolingClientLogger logger;
private FhirLoggingInterceptor fhirLoggingInterceptor;
private int retryCount;
private long timeout = DEFAULT_TIMEOUT;
private String base;
public String getBase() {
@ -51,14 +51,6 @@ public class Client {
this.retryCount = retryCount;
}
public long getTimeout() {
return timeout;
}
public void setTimeout(long timeout) {
this.timeout = timeout;
}
public <T extends Resource> ResourceRequest<T> issueOptionsRequest(URI optionsUri, String resourceFormat,
String message, long timeout) throws IOException {
Request.Builder request = new Request.Builder().method("OPTIONS", null).url(optionsUri.toURL());
@ -107,20 +99,20 @@ public class Client {
return executeFhirRequest(request, resourceFormat, headers, message, retryCount, timeout);
}
public boolean issueDeleteRequest(URI resourceUri) throws IOException {
public boolean issueDeleteRequest(URI resourceUri, int timeout) throws IOException {
Request.Builder request = new Request.Builder().url(resourceUri.toURL()).delete();
return executeFhirRequest(request, null, new Headers.Builder().build(), null, retryCount, timeout)
.isSuccessfulRequest();
}
public Bundle issueGetFeedRequest(URI resourceUri, String resourceFormat) throws IOException {
public Bundle issueGetFeedRequest(URI resourceUri, String resourceFormat, int timeout) throws IOException {
Request.Builder request = new Request.Builder().url(resourceUri.toURL());
return executeBundleRequest(request, resourceFormat, new Headers.Builder().build(), null, retryCount, timeout);
}
public Bundle issuePostFeedRequest(URI resourceUri, Map<String, String> parameters, String resourceName,
Resource resource, String resourceFormat) throws IOException {
Resource resource, String resourceFormat, int timeout) throws IOException {
String boundary = "----WebKitFormBoundarykbMUo6H8QaUnYtRy";
byte[] payload = ByteUtils.encodeFormSubmission(parameters, resourceName, resource, boundary);
RequestBody body = RequestBody.create(MediaType.parse(resourceFormat + ";charset=" + DEFAULT_CHARSET), payload);

View File

@ -0,0 +1,30 @@
package org.hl7.fhir.r4.ips;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.URISyntaxException;
import org.hl7.fhir.r4.formats.IParser.OutputStyle;
import org.hl7.fhir.r4.formats.JsonParser;
import org.hl7.fhir.r4.model.Base64BinaryType;
import org.hl7.fhir.r4.model.Bundle;
import org.hl7.fhir.r4.utils.client.FHIRToolingClient;
import org.hl7.fhir.utilities.Utilities;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
public class IpsBuilderTest {
@Test
@DisplayName("Test IPS Generation")
void testIpsGeneration() throws URISyntaxException, FileNotFoundException, IOException {
FHIRToolingClient server = new FHIRToolingClient("https://hl7auconnectathon.salessbx.smiledigitalhealth.com/fhir-request", "FHIR-Validator");
server.setUsername("HL7AU");
server.setPassword("Connectathon123");
Bundle bnd = IPSBuilder.generateIPS(server, "wang-li");
new JsonParser().setOutputStyle(OutputStyle.PRETTY).compose(new FileOutputStream(Utilities.path("[tmp]", "ips-gen.json")), bnd);
}
}

View File

@ -3340,9 +3340,11 @@ public class FHIRPathEngine {
}
case Iif: {
TypeDetails types = new TypeDetails(null);
types.update(paramTypes.get(0));
if (paramTypes.size() > 1) {
types.update(paramTypes.get(1));
checkSingleton(focus, "iif", exp);
checkParamTypes(exp, exp.getFunction().toCode(), paramTypes, new TypeDetails(CollectionStatus.SINGLETON, TypeDetails.FP_Boolean));
types.update(paramTypes.get(1));
if (paramTypes.size() > 2) {
types.update(paramTypes.get(2));
}
return types;
}
@ -3647,6 +3649,12 @@ public class FHIRPathEngine {
}
}
}
private void checkSingleton(TypeDetails focus, String name, ExpressionNode expr) throws PathEngineException {
if (focus.getCollectionStatus() != CollectionStatus.SINGLETON) {
// typeWarnings.add(new IssueMessage(worker.formatMessage(I18nConstants.FHIRPATH_COLLECTION_STATUS_CONTEXT, name, expr.toString()), I18nConstants.FHIRPATH_COLLECTION_STATUS_CONTEXT));
}
}
private void checkOrdered(TypeDetails focus, String name, ExpressionNode expr) throws PathEngineException {
if (focus.getCollectionStatus() == CollectionStatus.UNORDERED) {
@ -4809,9 +4817,12 @@ public class FHIRPathEngine {
}
private List<Base> funcIif(ExecutionContext context, List<Base> focus, ExpressionNode exp) throws FHIRException {
List<Base> n1 = execute(context, focus, exp.getParameters().get(0), true);
if (focus.size() > 1) {
throw makeException(exp, I18nConstants.FHIRPATH_NO_COLLECTION, "iif", focus.size());
}
List<Base> n1 = execute(focus.isEmpty() ? context : changeThis(context, focus.get(0)), focus, exp.getParameters().get(0), true);
Equality v = asBool(n1, exp);
if (v == Equality.True) {
return execute(context, focus, exp.getParameters().get(1), true);
} else if (exp.getParameters().size() < 3) {
@ -4852,7 +4863,7 @@ public class FHIRPathEngine {
for (Base item : focus) {
result.add(item);
}
for (Base item : execute(context, focus, exp.getParameters().get(0), true)) {
for (Base item : execute(context, baseToList(context.thisItem), exp.getParameters().get(0), true)) {
result.add(item);
}
return result;

View File

@ -39,6 +39,7 @@ import org.hl7.fhir.r4b.utils.client.network.ByteUtils;
import org.hl7.fhir.r4b.utils.client.network.Client;
import org.hl7.fhir.r4b.utils.client.network.ClientHeaders;
import org.hl7.fhir.r4b.utils.client.network.ResourceRequest;
import org.hl7.fhir.utilities.FHIRBaseToolingClient;
import org.hl7.fhir.utilities.ToolingClientLogger;
import org.hl7.fhir.utilities.Utilities;
@ -77,19 +78,13 @@ import java.util.*;
*
* @author Claude Nanjo
*/
public class FHIRToolingClient {
public class FHIRToolingClient extends FHIRBaseToolingClient{
public static final String DATETIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ssK";
public static final String DATE_FORMAT = "yyyy-MM-dd";
public static final String hostKey = "http.proxyHost";
public static final String portKey = "http.proxyPort";
private static final int TIMEOUT_NORMAL = 1500;
private static final int TIMEOUT_OPERATION = 30000;
private static final int TIMEOUT_ENTRY = 500;
private static final int TIMEOUT_OPERATION_LONG = 60000;
private static final int TIMEOUT_OPERATION_EXPAND = 120000;
private String base;
private ResourceAddress resourceAddress;
private ResourceFormat preferredResourceFormat;
@ -151,7 +146,7 @@ public class FHIRToolingClient {
TerminologyCapabilities capabilities = null;
try {
capabilities = (TerminologyCapabilities) client.issueGetResourceRequest(resourceAddress.resolveMetadataTxCaps(),
getPreferredResourceFormat(), generateHeaders(), "TerminologyCapabilities", TIMEOUT_NORMAL).getReference();
getPreferredResourceFormat(), generateHeaders(), "TerminologyCapabilities", timeoutNormal).getReference();
} catch (Exception e) {
throw new FHIRException("Error fetching the server's terminology capabilities", e);
}
@ -162,7 +157,7 @@ public class FHIRToolingClient {
CapabilityStatement conformance = null;
try {
conformance = (CapabilityStatement) client.issueGetResourceRequest(resourceAddress.resolveMetadataUri(false),
getPreferredResourceFormat(), generateHeaders(), "CapabilitiesStatement", TIMEOUT_NORMAL).getReference();
getPreferredResourceFormat(), generateHeaders(), "CapabilitiesStatement", timeoutNormal).getReference();
} catch (Exception e) {
throw new FHIRException("Error fetching the server's conformance statement", e);
}
@ -174,7 +169,7 @@ public class FHIRToolingClient {
return capabilities;
try {
capabilities = (CapabilityStatement) client.issueGetResourceRequest(resourceAddress.resolveMetadataUri(true),
getPreferredResourceFormat(), generateHeaders(), "CapabilitiesStatement-Quick", TIMEOUT_NORMAL)
getPreferredResourceFormat(), generateHeaders(), "CapabilitiesStatement-Quick", timeoutNormal)
.getReference();
} catch (Exception e) {
throw new FHIRException("Error fetching the server's capability statement: " + e.getMessage(), e);
@ -187,7 +182,7 @@ public class FHIRToolingClient {
try {
result = client.issueGetResourceRequest(resourceAddress.resolveGetUriFromResourceClassAndId(resourceClass, id),
getPreferredResourceFormat(), generateHeaders(), "Read " + resourceClass.getName() + "/" + id,
TIMEOUT_NORMAL);
timeoutNormal);
if (result.isUnsuccessfulRequest()) {
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(),
(OperationOutcome) result.getPayload());
@ -204,7 +199,7 @@ public class FHIRToolingClient {
result = client.issueGetResourceRequest(
resourceAddress.resolveGetUriFromResourceClassAndIdAndVersion(resourceClass, id, version),
getPreferredResourceFormat(), generateHeaders(),
"VRead " + resourceClass.getName() + "/" + id + "/?_history/" + version, TIMEOUT_NORMAL);
"VRead " + resourceClass.getName() + "/" + id + "/?_history/" + version, timeoutNormal);
if (result.isUnsuccessfulRequest()) {
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(),
(OperationOutcome) result.getPayload());
@ -221,7 +216,7 @@ public class FHIRToolingClient {
result = client.issueGetResourceRequest(
resourceAddress.resolveGetUriFromResourceClassAndCanonical(resourceClass, canonicalURL),
getPreferredResourceFormat(), generateHeaders(), "Read " + resourceClass.getName() + "?url=" + canonicalURL,
TIMEOUT_NORMAL);
timeoutNormal);
if (result.isUnsuccessfulRequest()) {
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(),
(OperationOutcome) result.getPayload());
@ -244,7 +239,7 @@ public class FHIRToolingClient {
resourceAddress.resolveGetUriFromResourceClassAndId(resource.getClass(), resource.getId()),
ByteUtils.resourceToByteArray(resource, false, isJson(getPreferredResourceFormat())),
getPreferredResourceFormat(), generateHeaders(), "Update " + resource.fhirType() + "/" + resource.getId(),
TIMEOUT_OPERATION);
timeoutOperation);
if (result.isUnsuccessfulRequest()) {
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(),
(OperationOutcome) result.getPayload());
@ -273,7 +268,7 @@ public class FHIRToolingClient {
result = client.issuePutRequest(resourceAddress.resolveGetUriFromResourceClassAndId(resourceClass, id),
ByteUtils.resourceToByteArray(resource, false, isJson(getPreferredResourceFormat())),
getPreferredResourceFormat(), generateHeaders(), "Update " + resource.fhirType() + "/" + id,
TIMEOUT_OPERATION);
timeoutOperation);
if (result.isUnsuccessfulRequest()) {
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(),
(OperationOutcome) result.getPayload());
@ -311,10 +306,10 @@ public class FHIRToolingClient {
if (complex) {
byte[] body = ByteUtils.resourceToByteArray(params, false, isJson(getPreferredResourceFormat()));
result = client.issuePostRequest(url, body, getPreferredResourceFormat(), generateHeaders(),
"POST " + resourceClass.getName() + "/$" + name, TIMEOUT_OPERATION_LONG);
"POST " + resourceClass.getName() + "/$" + name, timeoutLong);
} else {
result = client.issueGetResourceRequest(url, getPreferredResourceFormat(), generateHeaders(),
"GET " + resourceClass.getName() + "/$" + name, TIMEOUT_OPERATION_LONG);
"GET " + resourceClass.getName() + "/$" + name, timeoutLong);
}
if (result.isUnsuccessfulRequest()) {
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(),
@ -340,7 +335,7 @@ public class FHIRToolingClient {
transactionResult = client.postBatchRequest(resourceAddress.getBaseServiceUri(),
ByteUtils.resourceToByteArray(batch, false, isJson(getPreferredResourceFormat())),
getPreferredResourceFormat(), generateHeaders(), "transaction",
TIMEOUT_OPERATION + (TIMEOUT_ENTRY * batch.getEntry().size()));
timeoutOperation + (timeoutEntry * batch.getEntry().size()));
} catch (Exception e) {
handleException("An error occurred trying to process this transaction request", e);
}
@ -354,7 +349,7 @@ public class FHIRToolingClient {
result = client.issuePostRequest(resourceAddress.resolveValidateUri(resourceClass, id),
ByteUtils.resourceToByteArray(resource, false, isJson(getPreferredResourceFormat())),
getPreferredResourceFormat(), generateHeaders(),
"POST " + resourceClass.getName() + (id != null ? "/" + id : "") + "/$validate", TIMEOUT_OPERATION_LONG);
"POST " + resourceClass.getName() + (id != null ? "/" + id : "") + "/$validate", timeoutLong);
if (result.isUnsuccessfulRequest()) {
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(),
(OperationOutcome) result.getPayload());
@ -411,7 +406,7 @@ public class FHIRToolingClient {
try {
result = client.issuePostRequest(resourceAddress.resolveOperationUri(ValueSet.class, "expand"),
ByteUtils.resourceToByteArray(p, false, isJson(getPreferredResourceFormat())), getPreferredResourceFormat(),
generateHeaders(), "ValueSet/$expand?url=" + source.getUrl(), TIMEOUT_OPERATION_EXPAND);
generateHeaders(), "ValueSet/$expand?url=" + source.getUrl(), timeoutExpand);
if (result.isUnsuccessfulRequest()) {
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(),
(OperationOutcome) result.getPayload());
@ -426,7 +421,7 @@ public class FHIRToolingClient {
org.hl7.fhir.r4b.utils.client.network.ResourceRequest<Resource> result = null;
try {
result = client.issueGetResourceRequest(resourceAddress.resolveOperationUri(CodeSystem.class, "lookup", params),
getPreferredResourceFormat(), generateHeaders(), "CodeSystem/$lookup", TIMEOUT_NORMAL);
getPreferredResourceFormat(), generateHeaders(), "CodeSystem/$lookup", timeoutNormal);
} catch (IOException e) {
e.printStackTrace();
}
@ -448,7 +443,7 @@ public class FHIRToolingClient {
result = client.issuePostRequest(resourceAddress.resolveOperationUri(ValueSet.class, "expand", params),
ByteUtils.resourceToByteArray(p, false, isJson(getPreferredResourceFormat())), getPreferredResourceFormat(),
generateHeaders(), "ValueSet/$expand?url=" + source.getUrl(), TIMEOUT_OPERATION_EXPAND);
generateHeaders(), "ValueSet/$expand?url=" + source.getUrl(), timeoutExpand);
if (result.isUnsuccessfulRequest()) {
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(),
(OperationOutcome) result.getPayload());
@ -471,7 +466,7 @@ public class FHIRToolingClient {
result = client.issuePostRequest(
resourceAddress.resolveOperationUri(null, "closure", new HashMap<String, String>()),
ByteUtils.resourceToByteArray(params, false, isJson(getPreferredResourceFormat())),
getPreferredResourceFormat(), generateHeaders(), "Closure?name=" + name, TIMEOUT_NORMAL);
getPreferredResourceFormat(), generateHeaders(), "Closure?name=" + name, timeoutNormal);
if (result.isUnsuccessfulRequest()) {
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(),
(OperationOutcome) result.getPayload());
@ -491,7 +486,7 @@ public class FHIRToolingClient {
result = client.issuePostRequest(
resourceAddress.resolveOperationUri(null, "closure", new HashMap<String, String>()),
ByteUtils.resourceToByteArray(params, false, isJson(getPreferredResourceFormat())),
getPreferredResourceFormat(), generateHeaders(), "UpdateClosure?name=" + name, TIMEOUT_OPERATION);
getPreferredResourceFormat(), generateHeaders(), "UpdateClosure?name=" + name, timeoutOperation);
if (result.isUnsuccessfulRequest()) {
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(),
(OperationOutcome) result.getPayload());

View File

@ -44,22 +44,4 @@ public class XmlParserTests {
}
}
@Test
/**
* Deserializes a simplified CDA example into the logical model and checks that
* xml deserialization works for the xsi:type
*
* @throws IOException
*/
public void testXsiDeserialiserXmlParser() throws IOException {
Element cda = Manager.parseSingle(context,
TestingUtilities.loadTestResourceStream("validator", "cda", "example-xsi.xml"), FhirFormat.XML);
ByteArrayOutputStream baosXml = new ByteArrayOutputStream();
Manager.compose(context, cda, baosXml, FhirFormat.XML, OutputStyle.PRETTY, null);
String cdaSerialised = baosXml.toString();
Assertions.assertTrue(cdaSerialised.indexOf("xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"") > 0);
Assertions.assertTrue(cdaSerialised.indexOf("xsi:type=\"CD\"") > 0);
}
}

View File

@ -177,6 +177,8 @@ public abstract class CanonicalResourceComparer extends ResourceComparer {
s = s + refCell(left);
s = s + refCell(right);
s = s + "<td><a href=\""+getId()+".html\">Comparison</a></td>";
s = s + "<td><a href=\""+getId()+"-union.html\">Union</a></td>";
s = s + "<td><a href=\""+getId()+"-intersection.html\">Intersection</a></td>";
s = s + "<td>"+outcomeSummary()+"</td>";
return "<tr style=\"background-color: "+color()+"\">"+s+"</tr>\r\n";
}

View File

@ -183,20 +183,22 @@ public class CapabilityStatementComparer extends CanonicalResourceComparer {
private void compareRestSecurityService(CapabilityStatementRestSecurityComponent left, CapabilityStatementRestSecurityComponent right, StructuralMatch<Element> combined, CapabilityStatementRestSecurityComponent union, CapabilityStatementRestSecurityComponent intersection, CapabilityStatement csU, CapabilityStatement csI, CapabilityStatementComparison res, String path) {
List<CodeableConcept> matchR = new ArrayList<>();
for (CodeableConcept l : left.getService()) {
CodeableConcept r = findInList(right.getService(), l);
if (r == null) {
union.getService().add(l);
combined.getChildren().add(new StructuralMatch<Element>(l, vmI(IssueSeverity.INFORMATION, "Removed this item", path)));
} else {
matchR.add(r);
CodeableConcept cdM = CodeableConcept.merge(l, r);
CodeableConcept cdI = CodeableConcept.intersect(l, r);
union.getService().add(cdM);
intersection.getService().add(cdI);
StructuralMatch<Element> sm = new StructuralMatch<Element>(l, r);
compare(sm, l, r, path, res);
combined.getChildren().add(sm);
if (left != null) {
for (CodeableConcept l : left.getService()) {
CodeableConcept r = findInList(right.getService(), l);
if (r == null) {
union.getService().add(l);
combined.getChildren().add(new StructuralMatch<Element>(l, vmI(IssueSeverity.INFORMATION, "Removed this item", path)));
} else {
matchR.add(r);
CodeableConcept cdM = CodeableConcept.merge(l, r);
CodeableConcept cdI = CodeableConcept.intersect(l, r);
union.getService().add(cdM);
intersection.getService().add(cdI);
StructuralMatch<Element> sm = new StructuralMatch<Element>(l, r);
compare(sm, l, r, path, res);
combined.getChildren().add(sm);
}
}
}
if (right != null) {
@ -257,23 +259,23 @@ public class CapabilityStatementComparer extends CanonicalResourceComparer {
}
private void compareExpectations(StructuralMatch<Element> combined, Element left, Element right, String path, CapabilityStatementComparison res, Element union, Element intersection) {
Extension l = left.getExtensionByUrl(ToolingExtensions.EXT_CAP_STMT_EXPECT);
Extension r = right.getExtensionByUrl(ToolingExtensions.EXT_CAP_STMT_EXPECT);
if (l != null || r != null) {
if (l == null) {
union.addExtension(r.copy());
combined.getChildren().add(new StructuralMatch<Element>(vmI(IssueSeverity.INFORMATION, "Added this expectation", path), r));
} else if (r == null) {
union.addExtension(l.copy());
combined.getChildren().add(new StructuralMatch<Element>(l, vmI(IssueSeverity.INFORMATION, "Removed this expectation", path)));
} else {
StructuralMatch<Element> sm = new StructuralMatch<Element>(l, r);
List<Extension> l = left.getExtensionsByUrl(ToolingExtensions.EXT_CAP_STMT_EXPECT);
List<Extension> r = right.getExtensionsByUrl(ToolingExtensions.EXT_CAP_STMT_EXPECT);
if (l.size() == 1 || r.size() == 1) {
if (l.size() == 0) {
union.addExtension(r.get(0).copy());
combined.getChildren().add(new StructuralMatch<Element>(vmI(IssueSeverity.INFORMATION, "Added this expectation", path), r.get(0)));
} else if (r.size() == 0) {
union.addExtension(l.get(0).copy());
combined.getChildren().add(new StructuralMatch<Element>(l.get(0), vmI(IssueSeverity.INFORMATION, "Removed this expectation", path)));
} else if (l.size() == 1 && r.size() == 1) {
StructuralMatch<Element> sm = new StructuralMatch<Element>(l.get(0), r.get(0));
combined.getChildren().add(sm);
String ls = l.getValue().primitiveValue();
String rs = r.getValue().primitiveValue();
String ls = l.get(0).getValue().primitiveValue();
String rs = r.get(0).getValue().primitiveValue();
if (ls.equals(rs)) {
union.addExtension(l.copy());
intersection.addExtension(l.copy());
union.addExtension(l.get(0).copy());
intersection.addExtension(l.get(0).copy());
} else {
sm.getMessages().add(new ValidationMessage(Source.ProfileComparer, IssueType.INFORMATIONAL, path+".extension('http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation')", "Changed value for expectation: '"+ls+"' vs '"+rs+"'", IssueSeverity.WARNING));
String lowest = lower(ls, rs) ? ls : rs;

View File

@ -79,6 +79,8 @@ public class ComparisonRenderer implements IEvaluationContext {
b.append(" <td width=\"260\"><b>"+Utilities.escapeXml(leftName)+"</b></td>\r\n");
b.append(" <td width=\"260\"><b>"+Utilities.escapeXml(rightName)+"</b></td>\r\n");
b.append(" <td width=\"100\"><b>Difference</b></td>\r\n");
b.append(" <td width=\"100\"><b>Union</b></td>\r\n");
b.append(" <td width=\"100\"><b>Intersection</b></td>\r\n");
b.append(" <td width=\"260\"><b>Notes</b></td>\r\n");
b.append(" </tr>\r\n");
@ -225,8 +227,22 @@ public class ComparisonRenderer implements IEvaluationContext {
vars.put("errors", new StringType(new XhtmlComposer(true).compose(cs.renderErrors(comp))));
vars.put("metadata", new StringType(new XhtmlComposer(true).compose(cs.renderMetadata(comp, "", ""))));
vars.put("structure", new StringType(new XhtmlComposer(true).compose(cs.renderStructure(comp, "", "", "http://hl7.org/fhir"))));
String cnt = processTemplate(template, "CodeSystem", vars);
String union = new XhtmlComposer(true).compose(cs.renderUnion(comp, "", folder, "http://hl7.org/fhir"));
String intersection = new XhtmlComposer(true).compose(cs.renderIntersection(comp, "", folder, "http://hl7.org/fhir"));
vars.put("union", new StringType(union));
vars.put("intersection", new StringType(intersection));
String cnt = processTemplate(template, "Profile", vars);
TextFile.stringToFile(cnt, file(comp.getId()+".html"));
template = templates.get("Profile-Union");
cnt = processTemplate(template, "Profile-Union", vars);
TextFile.stringToFile(cnt, file(comp.getId()+"-union.html"));
template = templates.get("Profile-Intersection");
cnt = processTemplate(template, "Profile-Intersection", vars);
TextFile.stringToFile(cnt, file(comp.getId()+"-intersection.html"));
new org.hl7.fhir.r5.formats.JsonParser().setOutputStyle(OutputStyle.PRETTY).compose(new FileOutputStream(Utilities.path(folder, comp.getId() + "-union.json")), comp.getUnion());
new org.hl7.fhir.r5.formats.JsonParser().setOutputStyle(OutputStyle.PRETTY).compose(new FileOutputStream(Utilities.path(folder, comp.getId() + "-intersection.json")), comp.getIntersection());
}

View File

@ -5,6 +5,7 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.Set;
import org.hl7.fhir.exceptions.DefinitionException;
import org.hl7.fhir.exceptions.FHIRException;
@ -46,6 +47,7 @@ import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity;
import org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator;
import org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.Cell;
import org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.Row;
import org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.TableGenerationMode;
import org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.TableModel;
import org.hl7.fhir.utilities.xhtml.XhtmlNode;
@ -1252,10 +1254,21 @@ public class StructureDefinitionComparer extends CanonicalResourceComparer imple
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(Utilities.path("[tmp]", "compare"), false, true);
gen.setTranslator(session.getContextRight().translator());
TableModel model = gen.initComparisonTable(corePath, id);
genElementComp(null /* oome back to this later */, gen, model.getRows(), comp.combined, corePath, prefix, null, true);
genElementComp(null /* come back to this later */, gen, model.getRows(), comp.combined, corePath, prefix, null, true);
return gen.generate(model, prefix, 0, null);
}
public XhtmlNode renderUnion(ProfileComparison comp, String id, String prefix, String corePath) throws FHIRException, IOException {
StructureDefinitionRenderer sdr = new StructureDefinitionRenderer(new RenderingContext(utilsLeft.getContext(), null, utilsLeft.getTerminologyServiceOptions(), corePath, prefix, null, ResourceRendererMode.TECHNICAL, GenerationRules.IG_PUBLISHER).setPkp(this));
return sdr.generateTable(corePath, comp.union, false, prefix, false, id, true, corePath, prefix, false, true, null, false, sdr.getContext(), "u");
}
public XhtmlNode renderIntersection(ProfileComparison comp, String id, String prefix, String corePath) throws FHIRException, IOException {
StructureDefinitionRenderer sdr = new StructureDefinitionRenderer(new RenderingContext(utilsLeft.getContext(), null, utilsLeft.getTerminologyServiceOptions(), corePath, prefix, null, ResourceRendererMode.TECHNICAL, GenerationRules.IG_PUBLISHER).setPkp(this));
return sdr.generateTable(corePath, comp.intersection, false, prefix, false, id, true, corePath, prefix, false, true, null, false, sdr.getContext(), "i");
}
private void genElementComp(String defPath, HierarchicalTableGenerator gen, List<Row> rows, StructuralMatch<ElementDefinitionNode> combined, String corePath, String prefix, Row slicingRow, boolean root) throws IOException {
Row originalRow = slicingRow;
Row typesRow = null;

View File

@ -239,8 +239,8 @@ public class XmlSchemaGenerator {
private String getNs(StructureDefinition sd) {
String ns = "http://hl7.org/fhir";
if (sd.hasExtension(ToolingExtensions.EXT_XML_NAMESPACE))
ns = ToolingExtensions.readStringExtension(sd, ToolingExtensions.EXT_XML_NAMESPACE);
if (sd.hasExtension(ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED))
ns = ToolingExtensions.readStringExtension(sd, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED);
return ns;
}

View File

@ -262,7 +262,7 @@ public class ProfileUtilities extends TranslatingUtilities {
"http://hl7.org/fhir/tools/StructureDefinition/json-property-key",
"http://hl7.org/fhir/tools/StructureDefinition/type-specifier",
"http://hl7.org/fhir/tools/StructureDefinition/xml-choice-group",
"http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace",
ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED,
"http://hl7.org/fhir/StructureDefinition/elementdefinition-defaulttype"
);

View File

@ -60,7 +60,7 @@ import org.hl7.fhir.exceptions.NoTerminologyServiceException;
import org.hl7.fhir.exceptions.TerminologyServiceException;
import org.hl7.fhir.r5.conformance.profile.ProfileUtilities;
import org.hl7.fhir.r5.context.CanonicalResourceManager.CanonicalResourceProxy;
import org.hl7.fhir.r5.context.IWorkerContext.ILoggingService.LogCategory;
import org.hl7.fhir.r5.context.ILoggingService.LogCategory;
import org.hl7.fhir.r5.model.ActorDefinition;
import org.hl7.fhir.r5.model.BooleanType;
import org.hl7.fhir.r5.model.Bundle;
@ -3024,4 +3024,30 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte
}
}
public void unload() {
codeSystems.unload();
valueSets.unload();
maps.unload();
transforms.unload();
structures.unload();
typeManager.unload();
measures.unload();
libraries.unload();
guides.unload();
capstmts.unload();
searchParameters.unload();
questionnaires.unload();
operations.unload();
plans.unload();
actors.unload();
requirements.unload();
systems.unload();
binaries.clear();
validationCache.clear();
txCache.clear();
}
}

View File

@ -195,8 +195,13 @@ public class CanonicalResourceManager<T extends CanonicalResource> {
} else {
return resource instanceof StructureDefinition ? ((StructureDefinition) resource).getDerivationElement().primitiveValue() : null;
}
}
}
public void unload() {
if (proxy != null) {
resource = null;
}
}
}
public class MetadataResourceVersionComparator<T1 extends CachedCanonicalResource<T>> implements Comparator<T1> {
@ -659,4 +664,12 @@ public class CanonicalResourceManager<T extends CanonicalResource> {
}
public void unload() {
for (CachedCanonicalResource<T> t : list) {
t.unload();
}
}
}

View File

@ -362,8 +362,8 @@ public class ContextUtilities implements ProfileKnowledgeProvider {
public StructureDefinition fetchByJsonName(String key) {
for (StructureDefinition sd : context.fetchResourcesByType(StructureDefinition.class)) {
ElementDefinition ed = sd.getSnapshot().getElementFirstRep();
if (sd.getKind() == StructureDefinitionKind.LOGICAL && ed != null && ed.hasExtension(ToolingExtensions.EXT_JSON_NAME) &&
key.equals(ToolingExtensions.readStringExtension(ed, ToolingExtensions.EXT_JSON_NAME))) {
if (sd.getKind() == StructureDefinitionKind.LOGICAL && ed != null && ed.hasExtension(ToolingExtensions.EXT_JSON_NAME, ToolingExtensions.EXT_JSON_NAME_DEPRECATED) &&
key.equals(ToolingExtensions.readStringExtension(ed, ToolingExtensions.EXT_JSON_NAME, ToolingExtensions.EXT_JSON_NAME_DEPRECATED))) {
return sd;
}
}

View File

@ -0,0 +1,15 @@
package org.hl7.fhir.r5.context;
public interface ILoggingService {
public enum LogCategory {
INIT,
PROGRESS,
TX,
CONTEXT,
GENERATE,
HTML
}
public void logMessage(String message); // status messages, always display
public void logDebugMessage(ILoggingService.LogCategory category, String message); // verbose; only when debugging
public boolean isDebugLogging(); // whether to log debug information
}

View File

@ -499,19 +499,6 @@ public interface IWorkerContext {
public Map<String, NamingSystem> getNSUrlMap();
public TranslationServices translator();
public interface ILoggingService {
public enum LogCategory {
INIT,
PROGRESS,
TX,
CONTEXT,
GENERATE,
HTML
}
public void logMessage(String message); // status messages, always display
public void logDebugMessage(LogCategory category, String message); // verbose; only when debugging
public boolean isDebugLogging(); // whether to log debug information
}
public void setLogger(@Nonnull ILoggingService logger);
public ILoggingService getLogger();

View File

@ -53,7 +53,7 @@ import org.hl7.fhir.exceptions.DefinitionException;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.exceptions.FHIRFormatError;
import org.hl7.fhir.r5.context.CanonicalResourceManager.CanonicalResourceProxy;
import org.hl7.fhir.r5.context.IWorkerContext.ILoggingService.LogCategory;
import org.hl7.fhir.r5.context.ILoggingService.LogCategory;
import org.hl7.fhir.r5.formats.IParser;
import org.hl7.fhir.r5.formats.JsonParser;
import org.hl7.fhir.r5.formats.XmlParser;
@ -211,7 +211,7 @@ public class SimpleWorkerContext extends BaseWorkerContext implements IWorkerCon
private final boolean allowLoadingDuplicates;
@With
private final IWorkerContext.ILoggingService loggingService;
private final ILoggingService loggingService;
public SimpleWorkerContextBuilder() {
cacheTerminologyClientErrors = false;
@ -809,5 +809,6 @@ public class SimpleWorkerContext extends BaseWorkerContext implements IWorkerCon
}
}

View File

@ -3,7 +3,7 @@ package org.hl7.fhir.r5.context;
import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
public class SystemOutLoggingService implements IWorkerContext.ILoggingService {
public class SystemOutLoggingService implements ILoggingService {
private final boolean debug;

View File

@ -126,5 +126,14 @@ public class TypeManager {
return sd != null && sd.getKind() == StructureDefinitionKind.COMPLEXTYPE;
}
}
public void unload() {
structures.unload();
typeDefinitions.clear();
fhirTypeDefinitions.clear();
primitiveNames.clear();
dataTypeNames.clear();
}
}

View File

@ -59,6 +59,7 @@ import org.hl7.fhir.r5.formats.JsonCreator;
import org.hl7.fhir.r5.formats.JsonCreatorCanonical;
import org.hl7.fhir.r5.formats.JsonCreatorDirect;
import org.hl7.fhir.r5.model.ElementDefinition.TypeRefComponent;
import org.hl7.fhir.r5.model.ElementDefinition;
import org.hl7.fhir.r5.model.StructureDefinition;
import org.hl7.fhir.r5.utils.FHIRPathEngine;
import org.hl7.fhir.utilities.CommaSeparatedStringBuilder;
@ -104,18 +105,34 @@ public class JsonParser extends ParserBase {
}
public Element parse(String source, String type) throws Exception {
return parse(source, type, false);
}
public Element parse(String source, String type, boolean inner) throws Exception {
ValidatedFragment focusFragment = new ValidatedFragment(ValidatedFragment.FOCUS_NAME, "json", source.getBytes(StandardCharsets.UTF_8), false);
JsonObject obj = org.hl7.fhir.utilities.json.parser.JsonParser.parseObject(source, true, true);
String path = "/"+type;
StructureDefinition sd = getDefinition(focusFragment.getErrors(), -1, -1, type);
if (sd == null)
if (sd == null) {
return null;
}
if (inner) {
// we have an anonymous wrapper that has an arbitrarily named property with the specified type. We're going to invent a snapshot for that
sd = new StructureDefinition();
sd.setType("Wrapper");
ElementDefinition bEd = sd.getSnapshot().addElement();
ElementDefinition nEd = sd.getSnapshot().addElement();
bEd.setPath("Wrapper");
nEd.setPath("Wrapper."+obj.getProperties().get(0).getName());
nEd.addType().setCode(type);
nEd.setMax(obj.getProperties().get(0).getValue().isJsonArray() ? "*" : "1");
}
Element result = new Element(type, new Property(context, sd.getSnapshot().getElement().get(0), sd, this.profileUtilities)).setFormat(FhirFormat.JSON);
result.setPath(type);
checkObject(focusFragment.getErrors(), obj, result, path);
result.setType(type);
parseChildren(focusFragment.getErrors(), path, obj, result, true, new ArrayList<>());
parseChildren(focusFragment.getErrors(), path, obj, result, true, null);
result.numberChildren();
return result;
}

View File

@ -152,7 +152,7 @@ public abstract class ParserBase {
expectedName = expectedName.substring(expectedName.lastIndexOf("/")+1);
}
}
String expectedNamespace = ToolingExtensions.readStringExtension(logical, "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace");
String expectedNamespace = ToolingExtensions.readStringExtension(logical, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED);
if (matchesNamespace(expectedNamespace, ns) && matchesName(expectedName, name)) {
return logical;
} else {
@ -175,9 +175,9 @@ public abstract class ParserBase {
for (StructureDefinition sd : context.fetchResourcesByType(StructureDefinition.class)) {
if (sd.getDerivation() == TypeDerivationRule.SPECIALIZATION && !sd.getUrl().startsWith("http://hl7.org/fhir/StructureDefinition/de-")) {
String type = urlTail(sd.getType());
if(name.equals(type) && (ns == null || ns.equals(FormatUtilities.FHIR_NS)) && !ToolingExtensions.hasExtension(sd, "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace"))
if(name.equals(type) && (ns == null || ns.equals(FormatUtilities.FHIR_NS)) && !ToolingExtensions.hasAnyOfExtensions(sd, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED))
return sd;
String sns = ToolingExtensions.readStringExtension(sd, "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace");
String sns = ToolingExtensions.readStringExtension(sd, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED);
if ((name.equals(type) || name.equals(sd.getName())) && ns != null && ns.equals(sns))
return sd;
}

View File

@ -90,8 +90,8 @@ public class Property {
}
public String getJsonName() {
if (definition.hasExtension(ToolingExtensions.EXT_JSON_NAME)) {
return ToolingExtensions.readStringExtension(definition, ToolingExtensions.EXT_JSON_NAME);
if (definition.hasExtension(ToolingExtensions.EXT_JSON_NAME, ToolingExtensions.EXT_JSON_NAME_DEPRECATED)) {
return ToolingExtensions.readStringExtension(definition, ToolingExtensions.EXT_JSON_NAME, ToolingExtensions.EXT_JSON_NAME_DEPRECATED);
} else {
return getName();
}
@ -100,16 +100,18 @@ public class Property {
public String getXmlName() {
if (definition.hasExtension(ToolingExtensions.EXT_XML_NAME)) {
return ToolingExtensions.readStringExtension(definition, ToolingExtensions.EXT_XML_NAME);
} else if (definition.hasExtension(ToolingExtensions.EXT_XML_NAME_DEPRECATED)) {
return ToolingExtensions.readStringExtension(definition, ToolingExtensions.EXT_XML_NAME_DEPRECATED);
} else {
return getName();
}
}
public String getXmlNamespace() {
if (ToolingExtensions.hasExtension(definition, "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace")) {
return ToolingExtensions.readStringExtension(definition, "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace");
} else if (ToolingExtensions.hasExtension(structure, "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace")) {
return ToolingExtensions.readStringExtension(structure, "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace");
if (ToolingExtensions.hasAnyOfExtensions(definition, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED)) {
return ToolingExtensions.readStringExtension(definition, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED);
} else if (ToolingExtensions.hasAnyOfExtensions(structure, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED)) {
return ToolingExtensions.readStringExtension(structure, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED);
} else {
return FormatUtilities.FHIR_NS;
}
@ -596,7 +598,7 @@ public class Property {
public boolean hasJsonName() {
return definition.hasExtension(ToolingExtensions.EXT_JSON_NAME);
return definition.hasExtension(ToolingExtensions.EXT_JSON_NAME, ToolingExtensions.EXT_JSON_NAME_DEPRECATED);
}

View File

@ -469,18 +469,27 @@ public abstract class Element extends Base implements IBaseHasExtensions, IBaseE
*
* @param theUrl The URL. Must not be blank or null.
*/
public String getExtensionString(String theUrl) throws FHIRException {
List<Extension> ext = getExtensionsByUrl(theUrl);
if (ext.isEmpty())
return null;
if (ext.size() > 1)
throw new FHIRException("Multiple matching extensions found for extension '"+theUrl+"'");
if (!ext.get(0).hasValue())
return null;
if (!ext.get(0).getValue().isPrimitive())
throw new FHIRException("Extension '"+theUrl+"' could not be converted to a string");
return ext.get(0).getValue().primitiveValue();
}
public String getExtensionString(String theUrl) throws FHIRException {
List<Extension> ext = getExtensionsByUrl(theUrl);
if (ext.isEmpty())
return null;
if (ext.size() > 1)
throw new FHIRException("Multiple matching extensions found for extension '"+theUrl+"'");
if (!ext.get(0).hasValue())
return null;
if (!ext.get(0).getValue().isPrimitive())
throw new FHIRException("Extension '"+theUrl+"' could not be converted to a string");
return ext.get(0).getValue().primitiveValue();
}
public String getExtensionString(String... theUrls) throws FHIRException {
for (String url : theUrls) {
if (hasExtension(url)) {
return getExtensionString(url);
}
}
return null;
}
public StandardsStatus getStandardsStatus() {

View File

@ -44,6 +44,7 @@ import org.hl7.fhir.exceptions.DefinitionException;
import org.hl7.fhir.r5.context.IWorkerContext;
import org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionBindingComponent;
import org.hl7.fhir.r5.model.ExpressionNode.CollectionStatus;
import org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind;
import org.hl7.fhir.r5.model.TypeDetails.ProfiledTypeSorter;
import org.hl7.fhir.utilities.CommaSeparatedStringBuilder;
import org.hl7.fhir.utilities.Utilities;
@ -253,6 +254,14 @@ public class TypeDetails {
return true;
}
}
t = ProfiledType.ns(n);
StructureDefinition sd = context.fetchTypeDefinition(t);
if (sd != null && sd.getKind() != StructureDefinitionKind.LOGICAL && Utilities.existsInList(sd.getType(), "boolean", "string", "integer", "decimal", "Quantity", "dateTime", "time")) {
t = FP_NS+"System."+Utilities.capitalize(sd.getType());
if (typesContains(t)) {
return true;
}
}
}
for (String n: tn) {
String id = n.contains("#") ? n.substring(0, n.indexOf("#")) : n;

View File

@ -67,6 +67,7 @@ import org.hl7.fhir.r5.model.Timing;
import org.hl7.fhir.r5.model.Timing.EventTiming;
import org.hl7.fhir.r5.model.Timing.TimingRepeatComponent;
import org.hl7.fhir.r5.model.Timing.UnitsOfTime;
import org.hl7.fhir.r5.model.TriggerDefinition;
import org.hl7.fhir.r5.model.UriType;
import org.hl7.fhir.r5.model.UsageContext;
import org.hl7.fhir.r5.model.ValueSet;
@ -1202,11 +1203,7 @@ public class DataRenderer extends Renderer implements CodeResolver {
String s = Utilities.noString(ii.getValue()) ? "?ngen-9?" : ii.getValue();
NamingSystem ns = context.getContext().getNSUrlMap().get(ii.getSystem());
if (ns != null) {
if (ns.hasWebPath()) {
s = "<a href=\""+Utilities.escapeXml(ns.getWebPath())+"\">"+ns.present()+"</a>#"+s;
} else {
s = ns.present()+"#"+s;
}
s = ns.present()+"#"+s;
}
if (ii.hasType()) {
if (ii.getType().hasText())
@ -1235,8 +1232,48 @@ public class DataRenderer extends Renderer implements CodeResolver {
return s;
}
protected void renderIdentifier(XhtmlNode x, Identifier ii) {
x.addText(displayIdentifier(ii));
protected void renderIdentifier(XhtmlNode x, Identifier ii) {
if (ii.hasType()) {
if (ii.getType().hasText())
x.tx(ii.getType().getText()+":");
else if (ii.getType().hasCoding() && ii.getType().getCoding().get(0).hasDisplay())
x.tx(ii.getType().getCoding().get(0).getDisplay()+":");
else if (ii.getType().hasCoding() && ii.getType().getCoding().get(0).hasCode())
x.tx(lookupCode(ii.getType().getCoding().get(0).getSystem(), ii.getType().getCoding().get(0).getVersion(), ii.getType().getCoding().get(0).getCode())+":");
} else {
x.tx("id:");
}
x.nbsp();
NamingSystem ns = context.getContext().getNSUrlMap().get(ii.getSystem());
if (ns != null) {
if (ns.hasWebPath()) {
x.ah(ns.getWebPath()).tx("#");
} else {
x.tx(ns.present()+"#");
}
}
x.tx(Utilities.noString(ii.getValue()) ? "?ngen-9?" : ii.getValue());
if (ii.hasUse() || ii.hasPeriod()) {
x.nbsp();
x.tx("(");
if (ii.hasUse()) {
x.tx("use:");
x.nbsp();
x.tx(ii.getUse().toString());
}
if (ii.hasUse() && ii.hasPeriod()) {
x.tx(",");
x.nbsp();
}
if (ii.hasPeriod()) {
x.tx("period:");
x.nbsp();
x.tx(displayPeriod(ii.getPeriod()));
}
x.tx(")");
}
}
public static String displayHumanName(HumanName name) {
@ -1541,6 +1578,36 @@ public class DataRenderer extends Renderer implements CodeResolver {
render(x, u.getValue());
}
public void renderTriggerDefinition(XhtmlNode x, TriggerDefinition td) throws FHIRFormatError, DefinitionException, IOException {
XhtmlNode tbl = x.table("grid");
XhtmlNode tr = tbl.tr();
tr.td().b().tx("Type");
tr.td().tx(td.getType().getDisplay());
if (td.hasName()) {
tr = tbl.tr();
tr.td().b().tx("Name");
tr.td().tx(td.getType().getDisplay());
}
if (td.hasCode()) {
tr = tbl.tr();
tr.td().b().tx("Code");
renderCodeableConcept(tr.td(), td.getCode());
}
if (td.hasTiming()) {
tr = tbl.tr();
tr.td().b().tx("Timing");
render(tr.td(), td.getTiming());
}
if (td.hasCondition()) {
tr = tbl.tr();
tr.td().b().tx("Condition");
renderExpression(tr.td(), td.getCondition());
}
}
public void renderDataRequirement(XhtmlNode x, DataRequirement dr) throws FHIRFormatError, DefinitionException, IOException {
XhtmlNode tbl = x.table("grid");
XhtmlNode tr = tbl.tr();

View File

@ -61,6 +61,7 @@ import org.hl7.fhir.r5.model.StringType;
import org.hl7.fhir.r5.model.StructureDefinition;
import org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind;
import org.hl7.fhir.r5.model.Timing;
import org.hl7.fhir.r5.model.TriggerDefinition;
import org.hl7.fhir.r5.model.UriType;
import org.hl7.fhir.r5.model.UsageContext;
import org.hl7.fhir.r5.renderers.utils.BaseWrappers.BaseWrapper;
@ -512,6 +513,9 @@ public class ProfileDrivenRenderer extends ResourceRenderer {
} else if (e instanceof DataRequirement) {
DataRequirement p = (DataRequirement) e;
renderDataRequirement(x, p);
} else if (e instanceof TriggerDefinition) {
TriggerDefinition p = (TriggerDefinition) e;
renderTriggerDefinition(x, p);
} else if (e instanceof UsageContext) {
UsageContext p = (UsageContext) e;
renderUsageContext(x, p);

View File

@ -537,6 +537,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer {
}
}
public XhtmlNode generateTable(String defFile, StructureDefinition profile, boolean diff, String imageFolder, boolean inlineGraphics, String profileBaseFileName, boolean snapshot, String corePath, String imagePath,
boolean logicalModel, boolean allInvariants, Set<String> outputTracker, boolean mustSupport, RenderingContext rc, String anchorPrefix) throws IOException, FHIRException {
assert(diff != snapshot);// check it's ok to get rid of one of these
@ -1256,14 +1257,14 @@ public class StructureDefinitionRenderer extends ResourceRenderer {
row.getCells().add(c);
if (used) {
if (logicalModel && ToolingExtensions.hasExtension(profile, "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace")) {
if (logicalModel && ToolingExtensions.hasAnyOfExtensions(profile, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED)) {
if (root) {
c.getPieces().add(gen.new Piece(null, translate("sd.table", "XML Namespace")+": ", null).addStyle("font-weight:bold"));
c.getPieces().add(gen.new Piece(null, ToolingExtensions.readStringExtension(profile, "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace"), null));
} else if (!root && ToolingExtensions.hasExtension(definition, "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace") &&
!ToolingExtensions.readStringExtension(definition, "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace").equals(ToolingExtensions.readStringExtension(profile, "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace"))) {
c.getPieces().add(gen.new Piece(null, ToolingExtensions.readStringExtension(profile, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED), null));
} else if (!root && ToolingExtensions.hasAnyOfExtensions(definition, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED) &&
!ToolingExtensions.readStringExtension(definition, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED).equals(ToolingExtensions.readStringExtension(profile, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED))) {
c.getPieces().add(gen.new Piece(null, translate("sd.table", "XML Namespace")+": ", null).addStyle("font-weight:bold"));
c.getPieces().add(gen.new Piece(null, ToolingExtensions.readStringExtension(definition, "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace"), null));
c.getPieces().add(gen.new Piece(null, ToolingExtensions.readStringExtension(definition, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED), null));
}
}
if (root) {
@ -1416,27 +1417,22 @@ public class StructureDefinitionRenderer extends ResourceRenderer {
c.getPieces().add(gen.new Piece(null, translate("sd.table", "Choice Group")+": ", null).addStyle("font-weight:bold"));
c.getPieces().add(gen.new Piece(null, "This is a repeating choice group that does not appear directly in the instance", null));
}
if (definition.hasExtension(ToolingExtensions.EXT_XML_NAME)) {
if (definition.hasExtension(ToolingExtensions.EXT_XML_NAME, ToolingExtensions.EXT_XML_NAME_DEPRECATED)) {
if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); }
if (definition.hasExtension(ToolingExtensions.EXT_XML_NAMESPACE)) {
if (definition.hasExtension(ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED)) {
c.getPieces().add(gen.new Piece(null, translate("sd.table", "XML")+": ", null).addStyle("font-weight:bold"));
c.getPieces().add(gen.new Piece(null, definition.getExtensionString(ToolingExtensions.EXT_XML_NAME), null));
c.getPieces().add(gen.new Piece(null, definition.getExtensionString(ToolingExtensions.EXT_XML_NAME, ToolingExtensions.EXT_XML_NAME_DEPRECATED), null));
c.getPieces().add(gen.new Piece(null, " (", null));
c.getPieces().add(gen.new Piece(null, definition.getExtensionString(ToolingExtensions.EXT_XML_NAMESPACE), null));
c.getPieces().add(gen.new Piece(null, definition.getExtensionString(ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED), null));
c.getPieces().add(gen.new Piece(null, ")", null));
} else {
c.getPieces().add(gen.new Piece(null, translate("sd.table", "XML Element Name")+": ", null).addStyle("font-weight:bold"));
c.getPieces().add(gen.new Piece(null, definition.getExtensionString(ToolingExtensions.EXT_XML_NAME), null));
c.getPieces().add(gen.new Piece(null, definition.getExtensionString(ToolingExtensions.EXT_XML_NAME, ToolingExtensions.EXT_XML_NAME_DEPRECATED), null));
}
} else if (definition.hasExtension(ToolingExtensions.EXT_XML_NAMESPACE)) {
} else if (definition.hasExtension(ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED)) {
if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); }
c.getPieces().add(gen.new Piece(null, translate("sd.table", "XML Namespace")+": ", null).addStyle("font-weight:bold"));
c.getPieces().add(gen.new Piece(null, definition.getExtensionString(ToolingExtensions.EXT_XML_NAMESPACE), null));
}
if (root && ToolingExtensions.readBoolExtension(profile, ToolingExtensions.EXT_XML_NO_ORDER)) {
if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); }
c.getPieces().add(gen.new Piece(null, translate("sd.table", "XML Order")+": ", null).addStyle("font-weight:bold"));
c.getPieces().add(gen.new Piece(null, "The properties of this type can appear in any order in the XML", null));
c.getPieces().add(gen.new Piece(null, definition.getExtensionString(ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED), null));
}
if (definition.hasExtension(ToolingExtensions.EXT_JSON_EMPTY)) {
if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); }
@ -1447,7 +1443,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer {
c.getPieces().add(gen.new Piece(null, "JSON: This element may be present as a JSON Array even when there are no items in the instance", null));
}
}
String jn = ToolingExtensions.readStringExtension(definition, ToolingExtensions.EXT_JSON_NAME);
String jn = ToolingExtensions.readStringExtension(definition, ToolingExtensions.EXT_JSON_NAME, ToolingExtensions.EXT_JSON_NAME_DEPRECATED);
if (!Utilities.noString(jn)) {
if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); }
if (definition.getPath().contains(".")) {
@ -3642,11 +3638,12 @@ public class StructureDefinitionRenderer extends ResourceRenderer {
}
// tooling extensions for formats
if (ToolingExtensions.hasExtensions(d, ToolingExtensions.EXT_JSON_EMPTY, ToolingExtensions.EXT_JSON_PROP_KEY, ToolingExtensions.EXT_JSON_NULLABLE,
ToolingExtensions.EXT_JSON_NAME, ToolingExtensions.EXT_JSON_PRIMITIVE_CHOICE)) {
if (ToolingExtensions.hasAnyOfExtensions(d, ToolingExtensions.EXT_JSON_EMPTY, ToolingExtensions.EXT_JSON_PROP_KEY, ToolingExtensions.EXT_JSON_NULLABLE,
ToolingExtensions.EXT_JSON_NAME, ToolingExtensions.EXT_JSON_NAME_DEPRECATED, ToolingExtensions.EXT_JSON_PRIMITIVE_CHOICE)) {
tableRow(tbl, "JSON Format", null, strikethrough, describeJson(d));
}
if (d.hasExtension(ToolingExtensions.EXT_XML_NAMESPACE) || sd.hasExtension(ToolingExtensions.EXT_XML_NAMESPACE) || d.hasExtension(ToolingExtensions.EXT_XML_NAME) || (root && sd.hasExtension(ToolingExtensions.EXT_XML_NO_ORDER)) ||
if (d.hasExtension(ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED) || sd.hasExtension(ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED) ||
d.hasExtension(ToolingExtensions.EXT_XML_NAME, ToolingExtensions.EXT_XML_NAME_DEPRECATED) || sd.hasExtension(ToolingExtensions.EXT_XML_NAME, ToolingExtensions.EXT_XML_NAME_DEPRECATED) ||
d.hasRepresentation()) {
tableRow(tbl, "XML Format", null, strikethrough, describeXml(sd, d, root));
}
@ -3733,28 +3730,24 @@ public class StructureDefinitionRenderer extends ResourceRenderer {
}
}
}
String name = ToolingExtensions.readStringExtension(d, ToolingExtensions.EXT_XML_NAMESPACE);
String name = ToolingExtensions.readStringExtension(d, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED);
if (name == null && root) {
name = ToolingExtensions.readStringExtension(profile, ToolingExtensions.EXT_XML_NAMESPACE);
name = ToolingExtensions.readStringExtension(profile, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED);
}
if (name != null) {
ret.codeWithText("In the XML format, this property has the namespace ", name, ".");
}
name = ToolingExtensions.readStringExtension(d, ToolingExtensions.EXT_XML_NAME);
name = ToolingExtensions.readStringExtension(d, ToolingExtensions.EXT_XML_NAME, ToolingExtensions.EXT_XML_NAME_DEPRECATED);
if (name != null) {
ret.codeWithText("In the XML format, this property has the actual name", name, ".");
}
boolean no = root && ToolingExtensions.readBoolExtension(profile, ToolingExtensions.EXT_XML_NO_ORDER);
if (no) {
ret.tx("The children of this type can appear in any order in the XML.");
}
return ret;
}
private XhtmlNode describeJson(ElementDefinition d) {
XhtmlNode ret = new XhtmlNode(NodeType.Element, "div");
var ul = ret.ul();
boolean list = ToolingExtensions.countExtensions(d, ToolingExtensions.EXT_JSON_EMPTY, ToolingExtensions.EXT_JSON_PROP_KEY, ToolingExtensions.EXT_JSON_NULLABLE, ToolingExtensions.EXT_JSON_NAME) > 1;
boolean list = ToolingExtensions.countExtensions(d, ToolingExtensions.EXT_JSON_EMPTY, ToolingExtensions.EXT_JSON_PROP_KEY, ToolingExtensions.EXT_JSON_NULLABLE, ToolingExtensions.EXT_JSON_NAME, ToolingExtensions.EXT_JSON_NAME_DEPRECATED) > 1;
String code = ToolingExtensions.readStringExtension(d, ToolingExtensions.EXT_JSON_EMPTY);
if (code != null) {
@ -3770,7 +3763,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer {
break;
}
}
String jn = ToolingExtensions.readStringExtension(d, ToolingExtensions.EXT_JSON_NAME);
String jn = ToolingExtensions.readStringExtension(d, ToolingExtensions.EXT_JSON_NAME, ToolingExtensions.EXT_JSON_NAME_DEPRECATED);
if (jn != null) {
if (d.getPath().contains(".")) {
ul.li().codeWithText("This property appears in JSON with the property name ", jn, null);

View File

@ -187,6 +187,9 @@ public class ValueSetRenderer extends TerminologyRenderer {
if (vs.hasCopyright())
generateCopyright(x, vs);
}
boolean hasFragment = generateContentModeNotices(x, vs.getExpansion(), vs);
generateVersionNotice(x, vs.getExpansion(), vs);
if (ToolingExtensions.hasExtension(vs.getExpansion(), ToolingExtensions.EXT_EXP_TOOCOSTLY)) {
List<Extension> exl = vs.getExpansion().getExtensionsByUrl(ToolingExtensions.EXT_EXP_TOOCOSTLY);
boolean other = false;
@ -203,11 +206,9 @@ public class ValueSetRenderer extends TerminologyRenderer {
if (count == null)
x.para().tx("This value set does not contain a fixed number of concepts");
else
x.para().tx("This value set contains "+count.toString()+" concepts");
x.para().tx("This value set contains "+(hasFragment ? "at least " : "")+count.toString()+" concepts");
}
generateContentModeNotices(x, vs.getExpansion(), vs);
generateVersionNotice(x, vs.getExpansion(), vs);
boolean doLevel = false;
for (ValueSetExpansionContainsComponent cc : vs.getExpansion().getContains()) {
@ -319,12 +320,13 @@ public class ValueSetRenderer extends TerminologyRenderer {
return false;
}
private void generateContentModeNotices(XhtmlNode x, ValueSetExpansionComponent expansion, Resource vs) {
private boolean generateContentModeNotices(XhtmlNode x, ValueSetExpansionComponent expansion, Resource vs) {
generateContentModeNotice(x, expansion, "example", "Expansion based on example code system", vs);
generateContentModeNotice(x, expansion, "fragment", "Expansion based on code system fragment", vs);
return generateContentModeNotice(x, expansion, "fragment", "Expansion based on code system fragment", vs);
}
private void generateContentModeNotice(XhtmlNode x, ValueSetExpansionComponent expansion, String mode, String text, Resource vs) {
private boolean generateContentModeNotice(XhtmlNode x, ValueSetExpansionComponent expansion, String mode, String text, Resource vs) {
boolean res = false;
Multimap<String, String> versions = HashMultimap.create();
for (ValueSetExpansionParameterComponent p : expansion.getParameter()) {
if (p.getName().equals(mode)) {
@ -343,6 +345,7 @@ public class ValueSetRenderer extends TerminologyRenderer {
XhtmlNode p = x.para().style("border: black 1px dotted; background-color: #ffcccc; padding: 8px; margin-bottom: 8px");
p.tx(text+" ");
expRef(p, s, v, vs);
res = true;
}
} else {
for (String v : versions.get(s)) {
@ -351,12 +354,14 @@ public class ValueSetRenderer extends TerminologyRenderer {
div.para().tx(text+"s: ");
ul = div.ul();
first = false;
res = true;
}
expRef(ul.li(), s, v, vs);
}
}
}
}
return res;
}
private boolean checkDoSystem(ValueSet vs, ValueSet src) {

View File

@ -219,8 +219,14 @@ public class DirectWrappers {
Property family = b.getChildByName("family");
Property given = wrapped.getChildByName("given");
String s = given != null && given.hasValues() ? given.getValues().get(0).primitiveValue() : "";
if (family != null && family.hasValues())
s = s + " " + family.getValues().get(0).primitiveValue().toUpperCase();
if (family != null && family.hasValues()) {
String v = family.getValues().get(0).primitiveValue();
if (v == null) {
s = s + " " + "??";
} else {
s = s + " " + v.toUpperCase();
}
}
return s;
} else {
Property p = b.getChildByName("name");

View File

@ -54,7 +54,7 @@ public interface ITerminologyClient {
ValueSet expandValueset(ValueSet vs, Parameters p, Map<String, String> params) throws FHIRException;
Parameters validateCS(Parameters pin) throws FHIRException;
Parameters validateVS(Parameters pin) throws FHIRException;
ITerminologyClient setTimeout(int i) throws FHIRException;
ITerminologyClient setTimeoutFactor(int i) throws FHIRException;
ITerminologyClient setLogger(ToolingClientLogger txLog) throws FHIRException;
int getRetryCount() throws FHIRException;
ITerminologyClient setRetryCount(int retryCount) throws FHIRException;

View File

@ -668,8 +668,6 @@ public class ValueSetExpander extends ValueSetProcessBase {
}
if (langs == null && focus.hasLanguage()) {
langs = new AcceptLanguageHeader(focus.getLanguage(), true);
} else if (langs != null && langs.hasChosen()) {
focus.setLanguage(langs.getChosen());
}
try {

View File

@ -3272,6 +3272,7 @@ public class FHIRPathEngine {
case Count :
return new TypeDetails(CollectionStatus.SINGLETON, TypeDetails.FP_Integer);
case Where :
checkParamTypes(exp, exp.getFunction().toCode(), paramTypes, new TypeDetails(CollectionStatus.SINGLETON, TypeDetails.FP_Boolean));
// special case: where the focus is Reference, and the parameter to where is resolve() "is", we will suck up the target types
if (focus.hasType("Reference")) {
boolean canRestrictTargets = !exp.getParameters().isEmpty();
@ -3298,6 +3299,7 @@ public class FHIRPathEngine {
case Select :
return paramTypes.get(0);
case All :
checkParamTypes(exp, exp.getFunction().toCode(), paramTypes, new TypeDetails(CollectionStatus.SINGLETON, TypeDetails.FP_Boolean));
return new TypeDetails(CollectionStatus.SINGLETON, TypeDetails.FP_Boolean);
case Repeat :
return paramTypes.get(0);
@ -3383,9 +3385,11 @@ public class FHIRPathEngine {
}
case Iif : {
TypeDetails types = new TypeDetails(null);
types.update(paramTypes.get(0));
if (paramTypes.size() > 1) {
types.update(paramTypes.get(1));
checkSingleton(focus, "iif", exp);
checkParamTypes(exp, exp.getFunction().toCode(), paramTypes, new TypeDetails(CollectionStatus.SINGLETON, TypeDetails.FP_Boolean));
types.update(paramTypes.get(1));
if (paramTypes.size() > 2) {
types.update(paramTypes.get(2));
}
return types;
}
@ -3679,7 +3683,7 @@ public class FHIRPathEngine {
}
private void checkParamTypes(ExpressionNode expr, String funcName, List<TypeDetails> paramTypes, TypeDetails... typeSet) throws PathEngineException {
private void checkParamTypes(ExpressionNode expr, String funcName,List<TypeDetails> paramTypes, TypeDetails... typeSet) throws PathEngineException {
int i = 0;
for (TypeDetails pt : typeSet) {
if (i == paramTypes.size()) {
@ -3692,6 +3696,15 @@ public class FHIRPathEngine {
throw makeException(expr, I18nConstants.FHIRPATH_WRONG_PARAM_TYPE, funcName, i, a, pt.toString());
}
}
if (actual.getCollectionStatus() != CollectionStatus.SINGLETON && pt.getCollectionStatus() == CollectionStatus.SINGLETON) {
typeWarnings.add(new IssueMessage(worker.formatMessage(I18nConstants.FHIRPATH_COLLECTION_STATUS_PARAMETER, funcName, i, expr.toString()), I18nConstants.FHIRPATH_COLLECTION_STATUS_PARAMETER));
}
}
}
private void checkSingleton(TypeDetails focus, String name, ExpressionNode expr) throws PathEngineException {
if (focus.getCollectionStatus() != CollectionStatus.SINGLETON) {
typeWarnings.add(new IssueMessage(worker.formatMessage(I18nConstants.FHIRPATH_COLLECTION_STATUS_CONTEXT, name, expr.toString()), I18nConstants.FHIRPATH_COLLECTION_STATUS_CONTEXT));
}
}
@ -4811,9 +4824,12 @@ public class FHIRPathEngine {
private List<Base> funcIif(ExecutionContext context, List<Base> focus, ExpressionNode exp) throws FHIRException {
List<Base> n1 = execute(context, focus, exp.getParameters().get(0), true);
if (focus.size() > 1) {
throw makeException(exp, I18nConstants.FHIRPATH_NO_COLLECTION, "iif", focus.size());
}
List<Base> n1 = execute(focus.isEmpty() ? context : changeThis(context, focus.get(0)), focus, exp.getParameters().get(0), true);
Equality v = asBool(n1, exp);
if (v == Equality.True) {
return execute(context, focus, exp.getParameters().get(1), true);
} else if (exp.getParameters().size() < 3) {

View File

@ -117,8 +117,9 @@ public class ToolingExtensions {
public static final String EXT_ISSUE_COL = "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-col";
public static final String EXT_OO_FILE = "http://hl7.org/fhir/StructureDefinition/operationoutcome-file";
public static final String EXT_RESOURCE_IMPLEMENTS = "http://hl7.org/fhir/StructureDefinition/structuredefinition-implements";
public static final String EXT_XML_TYPE = "http://hl7.org/fhir/StructureDefinition/structuredefinition-xml-type";
public static final String EXT_XML_NAME = "http://hl7.org/fhir/StructureDefinition/elementdefinition-xml-name";
public static final String EXT_XML_TYPE = "http://hl7.org/fhir/StructureDefinition/structuredefinition-xml-type"; // r2 - r3
public static final String EXT_XML_NAME_DEPRECATED = "http://hl7.org/fhir/StructureDefinition/elementdefinition-xml-name";
public static final String EXT_XML_NAME = "http://hl7.org/fhir/tools/StructureDefinition/xml-name";
public static final String EXT_EXPLICIT_TYPE = "http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name";
public static final String EXT_IGP_RESOURCES = "http://hl7.org/fhir/StructureDefinition/igpublisher-folder-resource";
@ -137,7 +138,8 @@ public class ToolingExtensions {
public static final String EXT_IGP_RESOURCE_INFO = "http://hl7.org/fhir/tools/StructureDefinition/resource-information";
public static final String EXT_IGP_LOADVERSION = "http://hl7.org/fhir/StructureDefinition/igpublisher-loadversion";
public static final String EXT_LIST_PACKAGE = "http://hl7.org/fhir/StructureDefinition/list-packageId";
public static final String EXT_JSON_NAME = "http://hl7.org/fhir/tools/StructureDefinition/elementdefinition-json-name";
public static final String EXT_JSON_NAME_DEPRECATED = "http://hl7.org/fhir/tools/StructureDefinition/elementdefinition-json-name";
public static final String EXT_JSON_NAME = "http://hl7.org/fhir/tools/StructureDefinition/json-name";
public static final String EXT_BINDING_STYLE = "http://hl7.org/fhir/tools/StructureDefinition/elementdefinition-binding-style";
public static final String EXT_EXTENSION_STYLE = "http://hl7.org/fhir/tools/StructureDefinition/elementdefinition-extension-style";
public static final String EXT_LOGICAL_TARGET = "http://hl7.org/fhir/tools/StructureDefinition/logical-target";
@ -151,10 +153,6 @@ public class ToolingExtensions {
public static final String EXT_OT = "http://hl7.org/fhir/StructureDefinition/originalText";
public static final String EXT_CQF_EXP = "http://hl7.org/fhir/StructureDefinition/cqf-expression";
// validated
// private static final String EXT_OID = "http://hl7.org/fhir/StructureDefinition/valueset-oid";
// public static final String EXT_DEPRECATED = "http://hl7.org/fhir/StructureDefinition/codesystem-deprecated";
public static final String EXT_PATTERN = "http://hl7.org/fhir/StructureDefinition/elementdefinition-pattern";
public static final String EXT_ALLOWEDRESOURCE = "http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource";
private static final String EXT_ALLOWABLE_UNITS = "http://hl7.org/fhir/StructureDefinition/elementdefinition-allowedUnits";
@ -208,7 +206,8 @@ public class ToolingExtensions {
public static final String EXT_VS_COMMENT = "http://hl7.org/fhir/StructureDefinition/valueset-concept-comments";
public static final String EXT_VS_KEYWORD = "http://hl7.org/fhir/StructureDefinition/valueset-keyWord";
public static final String EXT_WORKGROUP = "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg";
public static final String EXT_XML_NAMESPACE = "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace";
public static final String EXT_XML_NAMESPACE_DEPRECATED = "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace";
public static final String EXT_XML_NAMESPACE = "http://hl7.org/fhir/tools/StructureDefinition/xml-namespace";
public static final String EXT_OLD_CONCEPTMAP_EQUIVALENCE = "http://hl7.org/fhir/1.0/StructureDefinition/extension-ConceptMap.element.target.equivalence";
public static final String EXT_Q_IS_SUBJ = "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-isSubject";
public static final String EXT_Q_HIDDEN = "http://hl7.org/fhir/StructureDefinition/questionnaire-hidden";
@ -221,7 +220,6 @@ public class ToolingExtensions {
public static final String EXT_ED_HEIRARCHY = "http://hl7.org/fhir/StructureDefinition/elementdefinition-heirarchy";
public static final String EXT_SD_IMPOSE_PROFILE = "http://hl7.org/fhir/StructureDefinition/structuredefinition-imposeProfile";
public static final String EXT_SD_COMPLIES_WITH_PROFILE = "http://hl7.org/fhir/StructureDefinition/structuredefinition-compliesWithProfile";
public static final String EXT_XML_NO_ORDER = "http://hl7.org/fhir/StructureDefinition/structuredefinition-xml-no-order";
public static final String EXT_DEF_TYPE = "http://hl7.org/fhir/StructureDefinition/elementdefinition-defaulttype";
public static final String EXT_TYPE_SPEC = "http://hl7.org/fhir/tools/StructureDefinition/type-specifier";
public static final String EXT_TYPE_CHARACTERISTICS = "http://hl7.org/fhir/StructureDefinition/structuredefinition-type-characteristics";
@ -413,6 +411,14 @@ public class ToolingExtensions {
return readStringExtension(def, EXT_DISPLAY_HINT);
}
public static String readStringExtension(Element c, String... uris) {
for (String uri : uris) {
if (hasExtension(c, uri)) {
return readStringExtension(c, uri);
}
}
return null;
}
public static String readStringExtension(Element c, String uri) {
Extension ex = ExtensionHelper.getExtension(c, uri);
if (ex == null)
@ -438,6 +444,14 @@ public class ToolingExtensions {
return ((StringType) ex.getValue()).getValue();
}
public static String readStringExtension(DomainResource c, String... uris) {
for (String uri : uris) {
if (hasExtension(c, uri)) {
return readStringExtension(c, uri);
}
}
return null;
}
public static String readStringExtension(DomainResource c, String uri) {
Extension ex = getExtension(c, uri);
if (ex == null)
@ -1099,7 +1113,7 @@ public class ToolingExtensions {
return cachedConsts;
}
public static boolean hasExtensions(ElementDefinition d, String... urls) {
public static boolean hasAnyOfExtensions(Element d, String... urls) {
for (String url : urls) {
if (d.hasExtension(url)) {
return true;
@ -1108,6 +1122,15 @@ public class ToolingExtensions {
return false;
}
public static boolean hasAnyOfExtensions(DomainResource dr, String... urls) {
for (String url : urls) {
if (dr.hasExtension(url)) {
return true;
}
}
return false;
}
public static int countExtensions(ElementDefinition d, String... urls) {
int res = 0;
for (String url : urls) {

View File

@ -38,6 +38,7 @@ import org.hl7.fhir.r5.model.Parameters.ParametersParameterComponent;
import org.hl7.fhir.r5.utils.client.network.ByteUtils;
import org.hl7.fhir.r5.utils.client.network.Client;
import org.hl7.fhir.r5.utils.client.network.ResourceRequest;
import org.hl7.fhir.utilities.FHIRBaseToolingClient;
import org.hl7.fhir.utilities.ToolingClientLogger;
import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.utilities.npm.FilesystemPackageCacheManager;
@ -76,7 +77,7 @@ import java.util.stream.Stream;
*
* @author Claude Nanjo
*/
public class FHIRToolingClient {
public class FHIRToolingClient extends FHIRBaseToolingClient {
private static final Logger logger = LoggerFactory.getLogger(FHIRToolingClient.class);
@ -86,12 +87,6 @@ public class FHIRToolingClient {
public static final String hostKey = "http.proxyHost";
public static final String portKey = "http.proxyPort";
private static final int TIMEOUT_NORMAL = 1500;
private static final int TIMEOUT_OPERATION = 30000;
private static final int TIMEOUT_ENTRY = 500;
private static final int TIMEOUT_OPERATION_LONG = 60000;
private static final int TIMEOUT_OPERATION_EXPAND = 120000;
private String base;
private ResourceAddress resourceAddress;
private ResourceFormat preferredResourceFormat;
@ -160,7 +155,7 @@ public class FHIRToolingClient {
preferredResourceFormat.getHeader(),
generateHeaders(),
message,
TIMEOUT_NORMAL).getReference();
timeoutNormal).getReference();
if (attemptedResourceFormat != preferredResourceFormat) {
setPreferredResourceFormat(attemptedResourceFormat);
}
@ -212,7 +207,7 @@ public class FHIRToolingClient {
getPreferredResourceFormat(),
generateHeaders(),
"Read " + resourceClass.getName() + "/" + id,
TIMEOUT_NORMAL);
timeoutNormal);
if (result.isUnsuccessfulRequest()) {
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload());
}
@ -229,7 +224,7 @@ public class FHIRToolingClient {
getPreferredResourceFormat(),
generateHeaders(),
"VRead " + resourceClass.getName() + "/" + id + "/?_history/" + version,
TIMEOUT_NORMAL);
timeoutNormal);
if (result.isUnsuccessfulRequest()) {
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload());
}
@ -246,7 +241,7 @@ public class FHIRToolingClient {
getPreferredResourceFormat(),
generateHeaders(),
"Read " + resourceClass.getName() + "?url=" + canonicalURL,
TIMEOUT_NORMAL);
timeoutNormal);
if (result.isUnsuccessfulRequest()) {
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload());
}
@ -269,7 +264,7 @@ public class FHIRToolingClient {
getPreferredResourceFormat(),
generateHeaders(),
"Update " + resource.fhirType() + "/" + resource.getId(),
TIMEOUT_OPERATION);
timeoutOperation);
if (result.isUnsuccessfulRequest()) {
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload());
}
@ -296,7 +291,7 @@ public class FHIRToolingClient {
getPreferredResourceFormat(),
generateHeaders(),
"Update " + resource.fhirType() + "/" + id,
TIMEOUT_OPERATION);
timeoutOperation);
if (result.isUnsuccessfulRequest()) {
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload());
}
@ -330,9 +325,9 @@ public class FHIRToolingClient {
if (complex) {
byte[] body = ByteUtils.resourceToByteArray(params, false, isJson(getPreferredResourceFormat()));
result = client.issuePostRequest(url, body, getPreferredResourceFormat(), generateHeaders(),
"POST " + resourceClass.getName() + "/$" + name, TIMEOUT_OPERATION_LONG);
"POST " + resourceClass.getName() + "/$" + name, timeoutLong);
} else {
result = client.issueGetResourceRequest(url, getPreferredResourceFormat(), generateHeaders(), "GET " + resourceClass.getName() + "/$" + name, TIMEOUT_OPERATION_LONG);
result = client.issueGetResourceRequest(url, getPreferredResourceFormat(), generateHeaders(), "GET " + resourceClass.getName() + "/$" + name, timeoutLong);
}
if (result.isUnsuccessfulRequest()) {
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload());
@ -355,7 +350,7 @@ public class FHIRToolingClient {
try {
transactionResult = client.postBatchRequest(resourceAddress.getBaseServiceUri(), ByteUtils.resourceToByteArray(batch, false, isJson(getPreferredResourceFormat())), getPreferredResourceFormat(),
generateHeaders(),
"transaction", TIMEOUT_OPERATION + (TIMEOUT_ENTRY * batch.getEntry().size()));
"transaction", timeoutOperation + (timeoutEntry * batch.getEntry().size()));
} catch (Exception e) {
handleException("An error occurred trying to process this transaction request", e);
}
@ -369,7 +364,7 @@ public class FHIRToolingClient {
result = client.issuePostRequest(resourceAddress.resolveValidateUri(resourceClass, id),
ByteUtils.resourceToByteArray(resource, false, isJson(getPreferredResourceFormat())),
getPreferredResourceFormat(), generateHeaders(),
"POST " + resourceClass.getName() + (id != null ? "/" + id : "") + "/$validate", TIMEOUT_OPERATION_LONG);
"POST " + resourceClass.getName() + (id != null ? "/" + id : "") + "/$validate", timeoutLong);
if (result.isUnsuccessfulRequest()) {
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload());
}
@ -428,7 +423,7 @@ public class FHIRToolingClient {
getPreferredResourceFormat(),
generateHeaders(),
"ValueSet/$expand?url=" + source.getUrl(),
TIMEOUT_OPERATION_EXPAND);
timeoutExpand);
} catch (IOException e) {
throw new FHIRException(e);
}
@ -446,7 +441,7 @@ public class FHIRToolingClient {
getPreferredResourceFormat(),
generateHeaders(),
"CodeSystem/$lookup",
TIMEOUT_NORMAL);
timeoutNormal);
} catch (IOException e) {
e.printStackTrace();
}
@ -475,7 +470,7 @@ public class FHIRToolingClient {
getPreferredResourceFormat(),
generateHeaders(),
source == null ? "ValueSet/$expand" : "ValueSet/$expand?url=" + source.getUrl(),
TIMEOUT_OPERATION_EXPAND);
timeoutExpand);
if (result.isUnsuccessfulRequest()) {
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload());
}
@ -499,7 +494,7 @@ public class FHIRToolingClient {
getPreferredResourceFormat(),
generateHeaders(),
"Closure?name=" + name,
TIMEOUT_NORMAL);
timeoutNormal);
if (result.isUnsuccessfulRequest()) {
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload());
}
@ -520,7 +515,7 @@ public class FHIRToolingClient {
getPreferredResourceFormat(),
generateHeaders(),
"UpdateClosure?name=" + name,
TIMEOUT_OPERATION);
timeoutOperation);
if (result.isUnsuccessfulRequest()) {
throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload());
}

View File

@ -0,0 +1,68 @@
package org.hl7.fhir.utilities;
public class FHIRBaseToolingClient {
private static final int DEFAULT_TIMEOUT_NORMAL = 1500;
private static final int DEFAULT_TIMEOUT_OPERATION = 30000;
private static final int DEFAULT_TIMEOUT_ENTRY = 500;
private static final int DEFAULT_TIMEOUT_OPERATION_LONG = 60000;
private static final int DEFAULT_TIMEOUT_OPERATION_EXPAND = 120000;
protected int timeoutNormal = DEFAULT_TIMEOUT_NORMAL;
protected int timeoutOperation = DEFAULT_TIMEOUT_OPERATION;
protected int timeoutEntry = DEFAULT_TIMEOUT_ENTRY;
protected int timeoutLong = DEFAULT_TIMEOUT_OPERATION_LONG;
protected int timeoutExpand = DEFAULT_TIMEOUT_OPERATION_EXPAND;
public long getTimeoutNormal() {
return timeoutNormal;
}
public void setTimeoutNormal(int timeoutNormal) {
this.timeoutNormal = timeoutNormal;
}
public long getTimeoutOperation() {
return timeoutOperation;
}
public void setTimeoutOperation(int timeoutOperation) {
this.timeoutOperation = timeoutOperation;
}
public long getTimeoutEntry() {
return timeoutEntry;
}
public void setTimeoutEntry(int timeoutEntry) {
this.timeoutEntry = timeoutEntry;
}
public long getTimeoutLong() {
return timeoutLong;
}
public void setTimeoutLong(int timeoutLong) {
this.timeoutLong = timeoutLong;
}
public long getTimeoutExpand() {
return timeoutExpand;
}
public void setTimeoutExpand(int timeoutExpand) {
this.timeoutExpand = timeoutExpand;
}
public void setTimeoutFactor(int i) {
timeoutNormal = i * DEFAULT_TIMEOUT_NORMAL;
timeoutOperation = i * DEFAULT_TIMEOUT_OPERATION;
timeoutEntry = i * DEFAULT_TIMEOUT_ENTRY;
timeoutLong = i * DEFAULT_TIMEOUT_OPERATION_LONG;
timeoutExpand = i * DEFAULT_TIMEOUT_OPERATION_EXPAND;
}
}

View File

@ -52,7 +52,7 @@ public class HL7WorkGroups {
case "claims": return "http://www.hl7.org/Special/committees/claims";
case "cqi": return "http://www.hl7.org/Special/committees/cqi";
case "dev": return "http://www.hl7.org/Special/committees/healthcaredevices";
case "ehr": return "http://www.hl7.org/special/committees/ehr";
case "ehr": return "http://www.hl7.org/Special/committees/ehr";
case "ec": return "http://www.hl7.org/Special/committees/emergencycare";
case "fhir": return "http://www.hl7.org/Special/committees/fiwg";
case "fmg": return "http://www.hl7.org/Special/committees/fhirmg";
@ -62,8 +62,8 @@ public class HL7WorkGroups {
case "hta": return "http://www.hl7.org/Special/committees/termauth";
case "ictc": return "http://www.hl7.org/Special/committees/ictc";
case "ii": return "http://www.hl7.org/Special/committees/imagemgt";
case "inm": return "http://www.hl7.org/special/committees/inm";
case "its": return "http://www.hl7.org/special/committees/xml";
case "inm": return "http://www.hl7.org/Special/committees/inm";
case "its": return "http://www.hl7.org/Special/committees/xml";
case "lhs": return "http://www.hl7.org/Special/committees/lhs";
case "mnm": return "http://www.hl7.org/Special/committees/mnm";
case "mobile": return "http://www.hl7.org/Special/committees/mobile";

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.validation.cli.utils;
package org.hl7.fhir.utilities;
import static org.apache.commons.lang3.StringUtils.defaultIfBlank;
import static org.apache.commons.lang3.StringUtils.left;
@ -34,11 +34,11 @@ import static org.apache.commons.lang3.StringUtils.left;
import java.io.InputStream;
import java.text.SimpleDateFormat;
import java.time.Duration;
import java.util.Date;
import java.util.Properties;
import org.hl7.fhir.r5.model.InstantType;
import org.hl7.fhir.utilities.Utilities;
/**
@ -93,12 +93,12 @@ public class VersionUtil {
private static String getDurationSinceBuild() {
try {
InstantType dt = new InstantType(ourBuildTime);
return Utilities.describeDuration(Duration.ofMillis(new Date().getTime() - dt.getValue().getTime()))+" old";
// InstantType dt = new InstantType(ourBuildTime);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
Date dt = sdf.parse(ourBuildTime.substring(0, 19));
return Utilities.describeDuration(Duration.ofMillis(new Date().getTime() - dt.getTime()))+" old";
} catch (Exception e) {
return "??";
}
}
}

View File

@ -63,9 +63,11 @@ public abstract class I18nBase {
private boolean messageExistsForLocale(String message, boolean hasArgs) {
checkResourceBundleIsLoaded();
if (!messageKeyExistsForLocale(message)) {
if (warnAboutMissingMessages && (hasArgs || !message.contains(" "))) {
System.out.println("Attempting to localize message " + message + ", but no such equivalent message exists for" +
" the locale " + getLocale());
if (!message.contains(" ")) {
if (warnAboutMissingMessages && (hasArgs || !message.contains(" "))) {
System.out.println("Attempting to localize message " + message + ", but no such equivalent message exists for" +
" the locale " + getLocale());
}
}
}
return messageKeyExistsForLocale(message);

View File

@ -1027,6 +1027,9 @@ public class I18nConstants {
public static final String BUNDLE_ENTRY_URL_MATCHES_NO_ID = "BUNDLE_ENTRY_URL_MATCHES_NO_ID";
public static final String BUNDLE_ENTRY_URL_ABSOLUTE = "BUNDLE_ENTRY_URL_ABSOLUTE";
public static final String BUNDLE_BUNDLE_ENTRY_FOUND_MULTIPLE = "BUNDLE_BUNDLE_ENTRY_FOUND_MULTIPLE";
public static final String FHIRPATH_COLLECTION_STATUS_PARAMETER = "FHIRPATH_COLLECTION_STATUS_PARAMETER";
public static final String FHIRPATH_COLLECTION_STATUS_CONTEXT = "FHIRPATH_COLLECTION_STATUS_CONTEXT";
public static final String SEARCHPARAMETER_MISSING_COMPONENTS = "SEARCHPARAMETER_MISSING_COMPONENTS";
}

View File

@ -3,19 +3,19 @@ package org.hl7.fhir.utilities.xhtml;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
@ -26,7 +26,7 @@ package org.hl7.fhir.utilities.xhtml;
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
@ -48,10 +48,11 @@ public class XhtmlComposer {
public static final String XHTML_NS = "http://www.w3.org/1999/xhtml";
private boolean pretty;
private boolean xml;
private boolean autoLinks;
public static final boolean XML = true;
public static final boolean HTML = false;
public XhtmlComposer(boolean xml, boolean pretty) {
super();
this.pretty = pretty;
@ -99,11 +100,11 @@ public class XhtmlComposer {
private void composeDoc(XhtmlDocument doc) throws IOException {
// headers....
// dst.append("<html>" + (pretty ? "\r\n" : ""));
// dst.append("<html>" + (pretty ? "\r\n" : ""));
for (XhtmlNode c : doc.getChildNodes()) {
writeNode(" ", c, false);
}
// dst.append("</html>" + (pretty ? "\r\n" : ""));
// dst.append("</html>" + (pretty ? "\r\n" : ""));
}
private void writeNode(String indent, XhtmlNode node, boolean noPrettyOverride) throws IOException {
@ -126,50 +127,73 @@ public class XhtmlComposer {
}
}
private boolean isValidUrlChar(char c) {
return Character.isAlphabetic(c) || Character.isDigit(c) || Utilities.existsInList(c, ';', ',', '/', '?', ':', '@', '&', '=', '+', '$', '-', '_', '.', '!', '~', '*', '\'', '(', ')');
}
private void writeText(XhtmlNode node) throws IOException {
for (char c : node.getContent().toCharArray())
{
if (c == '&') {
dst.append("&amp;");
} else if (c == '<') {
dst.append("&lt;");
} else if (c == '>') {
dst.append("&gt;");
} else if (xml) {
if (c == '"')
dst.append("&quot;");
else
dst.append(c);
String src = node.getContent();
int i = 0;
while (i < src.length()) {
char c = src.charAt(i);
if (autoLinks && c == 'h' && Utilities.startsWithInList(src.substring(i), "http://", "https://")) {
int j = i;
while (i < src.length() && isValidUrlChar(src.charAt(i))) {
i++;
}
String url = src.substring(j, i);
if (url.endsWith(".") || url.endsWith(",")) {
i--;
url = url.substring(0, url.length()-1);
}
url = Utilities.escapeXml(url);
dst.append("<a href=\""+url+"\">"+ url +"</a>");
} else {
if (c == XhtmlNode.NBSP.charAt(0))
dst.append("&nbsp;");
else if (c == (char) 0xA7)
dst.append("&sect;");
else if (c == (char) 169)
dst.append("&copy;");
else if (c == (char) 8482)
dst.append("&trade;");
else if (c == (char) 956)
dst.append("&mu;");
else if (c == (char) 174)
dst.append("&reg;");
else
dst.append(c);
i++;
if (c == '&') {
dst.append("&amp;");
} else if (c == '<') {
dst.append("&lt;");
} else if (c == '>') {
dst.append("&gt;");
} else if (xml) {
if (c == '"')
dst.append("&quot;");
else
dst.append(c);
} else {
if (c == XhtmlNode.NBSP.charAt(0))
dst.append("&nbsp;");
else if (c == (char) 0xA7)
dst.append("&sect;");
else if (c == (char) 169)
dst.append("&copy;");
else if (c == (char) 8482)
dst.append("&trade;");
else if (c == (char) 956)
dst.append("&mu;");
else if (c == (char) 174)
dst.append("&reg;");
else
dst.append(c);
}
}
}
}
private void writeComment(String indent, XhtmlNode node, boolean noPrettyOverride) throws IOException {
dst.append(indent + "<!-- " + node.getContent().trim() + " -->" + (pretty && !noPrettyOverride ? "\r\n" : ""));
}
}
private void writeDocType(XhtmlNode node) throws IOException {
dst.append("<!" + node.getContent() + ">\r\n");
}
}
private void writeInstruction(XhtmlNode node) throws IOException {
dst.append("<?" + node.getContent() + "?>\r\n");
}
}
private String escapeHtml(String s) {
if (s == null || s.equals(""))
@ -188,14 +212,14 @@ public class XhtmlComposer {
b.append(c);
return b.toString();
}
private String attributes(XhtmlNode node) {
StringBuilder s = new StringBuilder();
for (String n : node.getAttributes().keySet())
s.append(" " + n + "=\"" + escapeHtml(node.getAttributes().get(n)) + "\"");
return s.toString();
}
private void writeElement(String indent, XhtmlNode node, boolean noPrettyOverride) throws IOException {
if (!pretty || noPrettyOverride)
indent = "";
@ -242,7 +266,7 @@ public class XhtmlComposer {
public void compose(IXMLWriter xml, XhtmlNode node) throws IOException {
compose(xml, node, false);
}
public void compose(IXMLWriter xml, XhtmlNode node, boolean noPrettyOverride) throws IOException {
if (node.getNodeType() == NodeType.Comment)
xml.comment(node.getContent(), pretty && !noPrettyOverride);
@ -257,11 +281,11 @@ public class XhtmlComposer {
private void composeElement(IXMLWriter xml, XhtmlNode node, boolean noPrettyOverride) throws IOException {
for (String n : node.getAttributes().keySet()) {
if (n.equals("xmlns"))
xml.setDefaultNamespace(node.getAttributes().get(n));
xml.setDefaultNamespace(node.getAttributes().get(n));
else if (n.startsWith("xmlns:"))
xml.namespace(n.substring(6), node.getAttributes().get(n));
xml.namespace(n.substring(6), node.getAttributes().get(n));
else
xml.attribute(n, node.getAttributes().get(n));
xml.attribute(n, node.getAttributes().get(n));
}
xml.enter(XHTML_NS, node.getName());
for (XhtmlNode n : node.getChildNodes())
@ -299,7 +323,7 @@ public class XhtmlComposer {
b.append("* ");
lastWS = true;
}
for (XhtmlNode n : x.getChildNodes()) {
lastWS = composePlainText(n, b, lastWS);
}
@ -379,5 +403,14 @@ public class XhtmlComposer {
}
return sdst.toString();
}
public boolean isAutoLinks() {
return autoLinks;
}
public XhtmlComposer setAutoLinks(boolean autoLinks) {
this.autoLinks = autoLinks;
return this;
}
}

View File

@ -1290,6 +1290,15 @@ public class XhtmlParser {
return div.getChildNodes();
}
public List<XhtmlNode> parseMDFragmentStripParas(String source) throws IOException, FHIRException {
XhtmlNode div = parseFragment( "<div>"+source+"</div>");
List<XhtmlNode> res = new ArrayList<>();
for (XhtmlNode x : div.getChildNodes()) {
res.addAll(x.getChildNodes());
}
return res;
}
public XhtmlNode parseFragment(String source) throws IOException, FHIRException {
rdr = new StringReader(source);
try {

View File

@ -53,7 +53,7 @@ Extension_EXT_SubExtension_Invalid = Sub-extension url ''{0}'' is not defined by
Extension_EXT_Type = The Extension ''{0}'' definition allows for the types {1} but found type {2}
Extension_EXT_URL_Absolute = Extension.url must be an absolute URL
Extension_EXT_Unknown = Unknown extension {0}
Extension_EXT_Unknown_NotHere = The extension {0} is unknown, and not allowed here
Extension_EXT_Unknown_NotHere = The extension {0} could not be found so is not allowed here
Extension_EXT_Url_NotFound = Extension.url is required
Extension_EXT_Version_Internal = Extension url ''{0}'' evaluation state invalid
Extension_EXT_Version_Invalid = Extension url ''{0}'' is not valid (invalid Version ''{1}'')
@ -78,7 +78,7 @@ Profile_VAL_NotAllowed = The element {0} is present in the instance but not allo
Measure_MR_M_None = No Measure is identified, so no validation can be performed against the Measure
Measure_MR_M_NotFound = The Measure ''{0}'' could not be resolved, so no validation can be performed against the Measure
Questionnaire_QR_Item_BadOption = The code provided {1} in the system {0}) is not in the options value set ({2}) in the questionnaire: {3}
QUESTIONNAIRE_QR_ITEM_BADOPTION_CS = The code provided {1} cannot be validated in the options value set ({2}) in the questionnaire because the system {0} is unknown
QUESTIONNAIRE_QR_ITEM_BADOPTION_CS = The code provided {1} cannot be validated in the options value set ({2}) in the questionnaire because the system {0} could not be found
Questionnaire_QR_Item_Coding = Error {0} validating Coding against Questionnaire Options
Questionnaire_QR_Item_CodingNoOptions = Cannot validate Coding option because no option list is provided
Questionnaire_QR_Item_DateNoOptions = Cannot validate date answer option because no option list is provided
@ -157,7 +157,7 @@ Terminology_TX_Coding_Count = Expected {0} but found {1} coding elements
Terminology_TX_Confirm_1_CC = Could not confirm that the codings provided are in the value set {0} and a coding from this value set is required (class = {1})
Terminology_TX_Confirm_2_CC = Could not confirm that the codings provided are in the value set {0} and a coding should come from this value set unless it has no suitable code (the validator cannot judge what is suitable) (class = {1})
Terminology_TX_Confirm_3_CC = Could not confirm that the codings provided are in the value set {0} and a coding is recommended to come from this value set (class = {1})
Terminology_TX_Confirm_4a = The code provided ({2}) is not in the value set {0}, and a code from this value set is required: {1}
Terminology_TX_Confirm_4a = The code provided ({2}) was not found in the value set {0}, and a code from this value set is required: {1}
Terminology_TX_Confirm_4b = The codes provided ({2}) are not in the value set {0}, and a code from this value set is required: {1}
Terminology_TX_Confirm_5 = Could not confirm that the codes provided are in the value set {0}, and a code should come from this value set unless it has no suitable code (the validator cannot judge what is suitable)
Terminology_TX_Confirm_6 = Could not confirm that the codes provided are in the value set {0}, and a code is recommended to come from this value set
@ -169,24 +169,24 @@ Terminology_TX_Error_Coding2 = Error {0} validating Coding: {1}
Terminology_TX_NoValid_1_CC = None of the codings provided are in the value set {0}, and a coding from this value set is required) (codes = {1})
Terminology_TX_NoValid_10 = The code provided is not in the maximum value set {0}, and a code from this value set is required) (code = {1}#{2})
Terminology_TX_NoValid_11 = The code provided is not in the maximum value set {0}, and a code from this value set is required) (code = {1}#{2}), error = {3})
Terminology_TX_NoValid_12 = The Coding provided ({2}) is not in the value set {0}, and a code is required from this value set. {1}
Terminology_TX_NoValid_13 = The Coding provided ({2}) is not in the value set {0}, and a code should come from this value set unless it has no suitable code (note that the validator cannot judge what is suitable). {1}
Terminology_TX_NoValid_14 = The Coding provided ({2}) is not in the value set {0}, and a code is recommended to come from this value set. {1}
Terminology_TX_NoValid_12 = The Coding provided ({2}) was not found in the value set {0}, and a code is required from this value set. {1}
Terminology_TX_NoValid_13 = The Coding provided ({2}) was not found in the value set {0}, and a code should come from this value set unless it has no suitable code (note that the validator cannot judge what is suitable). {1}
Terminology_TX_NoValid_14 = The Coding provided ({2}) was not found in the value set {0}, and a code is recommended to come from this value set. {1}
Terminology_TX_NoValid_15 = The value provided (''{0}'') could not be validated in the absence of a terminology server
Terminology_TX_NoValid_15A = The value provided (''{0}'') could not be validated because the code system {1} is not known
Terminology_TX_NoValid_16 = The value provided (''{0}'') is not in the value set {1}, and a code is required from this value set {2}
Terminology_TX_NoValid_17 = The value provided (''{0}'') is not in the value set {1}, and a code should come from this value set unless it has no suitable code (note that the validator cannot judge what is suitable) {2}
Terminology_TX_NoValid_18 = The value provided (''{0}'') is not in the value set {1}, and a code is recommended to come from this value set){2}
Terminology_TX_NoValid_16 = The value provided (''{0}'') was not found in the value set {1}, and a code is required from this value set {2}
Terminology_TX_NoValid_17 = The value provided (''{0}'') was not found in the value set {1}, and a code should come from this value set unless it has no suitable code (note that the validator cannot judge what is suitable) {2}
Terminology_TX_NoValid_18 = The value provided (''{0}'') was not found in the value set {1}, and a code is recommended to come from this value set){2}
Terminology_TX_NoValid_2_CC = None of the codings provided are in the value set {0}, and a coding should come from this value set unless it has no suitable code (note that the validator cannot judge what is suitable) (codes = {1})
Terminology_TX_NoValid_3_CC = None of the codings provided are in the value set {0}, and a coding is recommended to come from this value set) (codes = {1})
Terminology_TX_NoValid_4 = The Coding provided ({2}) is not in the value set {0}, and a code is required from this value set {1}
Terminology_TX_NoValid_5 = The Coding provided ({2}) is not in the value set {0}, and a code should come from this value set unless it has no suitable code (the validator cannot judge what is suitable) {1}
Terminology_TX_NoValid_6 = The Coding provided ({2}) is not in the value set {0}, and a code is recommended to come from this value set {1}
Terminology_TX_NoValid_4 = The Coding provided ({2}) was not found in the value set {0}, and a code is required from this value set {1}
Terminology_TX_NoValid_5 = The Coding provided ({2}) was not found in the value set {0}, and a code should come from this value set unless it has no suitable code (the validator cannot judge what is suitable) {1}
Terminology_TX_NoValid_6 = The Coding provided ({2}) was not found in the value set {0}, and a code is recommended to come from this value set {1}
Terminology_TX_NoValid_7 = None of the codes provided could be validated against the maximum value set {0}, (error = {2})
Terminology_TX_NoValid_8 = None of the codes provided are in the maximum value set {0}, and a code from this value set is required) (codes = {1})
Terminology_TX_NoValid_9 = The code provided ({2}) could not be validated against the maximum value set {0}, (error = {1})
Terminology_TX_System_Invalid = Invalid System URI: {0}
Terminology_TX_System_NotKnown = Code System URI ''{0}'' is unknown so the code cannot be validated
Terminology_TX_System_NotKnown = Code System URI ''{0}'' could not be found so the code cannot be validated
TERMINOLOGY_TX_SYSTEM_NOT_USABLE = The definition for the Code System with URI ''{0}'' doesn't provide any codes so the code cannot be validated
Terminology_TX_System_Relative = Coding.system must be an absolute reference, not a local reference
Terminology_TX_System_Unknown = Unknown Code System ''{0}''
@ -257,10 +257,10 @@ Validation_VAL_Profile_NotAllowed = This element is not allowed by the profile {
Validation_VAL_Profile_NotSlice = This element does not match any known slice {0} and slicing is CLOSED: {1}
Validation_VAL_Profile_OutOfOrder = As specified by profile {0}, Element ''{1}'' is out of order (found after {2})
Validation_VAL_Profile_SliceOrder = As specified by profile {0}, Element ''{1}'' is out of order in ordered slice
Validation_VAL_Profile_Unknown = Profile reference ''{0}'' has not been checked because it is unknown
VALIDATION_VAL_PROFILE_UNKNOWN_NOT_POLICY = Profile reference ''{0}'' has not been checked because it is unknown, and the validator is set to not fetch unknown profiles
VALIDATION_VAL_PROFILE_UNKNOWN_ERROR = Profile reference ''{0}'' has not been checked because it is unknown, and fetching it resulted in the error {1}
VALIDATION_VAL_PROFILE_UNKNOWN_ERROR_NETWORK = Profile reference ''{0}'' has not been checked because it is unknown, and the host {1} cannot be found
Validation_VAL_Profile_Unknown = Profile reference ''{0}'' has not been checked because it could not be found
VALIDATION_VAL_PROFILE_UNKNOWN_NOT_POLICY = Profile reference ''{0}'' has not been checked because it could not be found, and the validator is set to not fetch unknown profiles
VALIDATION_VAL_PROFILE_UNKNOWN_ERROR = Profile reference ''{0}'' has not been checked because it could not be found, and fetching it resulted in the error {1}
VALIDATION_VAL_PROFILE_UNKNOWN_ERROR_NETWORK = Profile reference ''{0}'' has not been checked because it could not be found, and the host {1} cannot be found
Validation_VAL_Unknown_Profile = Unknown profile {0}
VALIDATION_VAL_PROFILE_DEPENDS_NOT_RESOLVED = Profile {1} identifies {2} as a dependency (using the extension http://hl7.org/fhir/StructureDefinition/structuredefinition-dependencies), but this profile could not be found
XHTML_XHTML_Attribute_Illegal = Invalid attribute name in the XHTML (''{0}'' on ''{1}'')
@ -476,7 +476,7 @@ Display_Name_WS_for__should_be_one_of__instead_of_other = Wrong whitespace in Di
Unknown_Code__in_ = Unknown Code ''{0}'' in the system ''{1}''
UNKNOWN_CODE__IN_FRAGMENT = Unknown Code ''{0}'' in the system ''{1}'' - note that the code system is labeled as a fragment, so the code may be valid in some other fragment
Code_found_in_expansion_however_ = Code found in expansion, however: {0}
None_of_the_provided_codes_are_in_the_value_set_one = The provided code {2} is not in the value set ''{1}''
None_of_the_provided_codes_are_in_the_value_set_one = The provided code {2} was not found in the value set ''{1}''
None_of_the_provided_codes_are_in_the_value_set_other = None of the provided codes [{2}] are in the value set ''{1}''
Coding_has_no_system__cannot_validate = Coding has no system - cannot validate
Unable_to_handle_system__concept_filter_with_op__ = Unable to handle system {0} concept filter with op = {1}
@ -484,7 +484,7 @@ UNABLE_TO_HANDLE_SYSTEM__PROPERTY_FILTER_WITH_OP__ = Unable to handle system {0}
Unable_to_handle_system__filter_with_property__ = Unable to handle system {0} filter with property = {1}, op = {2}
Unable_to_resolve_system__value_set_has_include_with_no_system = Unable to resolve system - value set {0} include #{1} has no system
UNABLE_TO_RESOLVE_SYSTEM_SYSTEM_IS_INDETERMINATE = The code system {1} referred to from value set {0} has a grammar, and the code might be valid in it
Unable_to_resolve_system__value_set_has_include_with_unknown_system = Unable to resolve system - value set {0} include #{1} has system {2} which is unknown, and the server return error {3}
Unable_to_resolve_system__value_set_has_include_with_unknown_system = Unable to resolve system - value set {0} include #{1} has system {2} which icould not be found, and the server returned error {3}
Unable_to_resolve_system__value_set_has_include_with_filter = Unable to resolve system - value set {0} include #{1} has a filter on system {2}
Unable_to_resolve_system__value_set_has_imports = Unable to resolve system - value set has imports
Unable_to_resolve_system__value_set_has_multiple_matches = Unable to resolve system - value set expansion has multiple matches: {0}
@ -568,6 +568,7 @@ SEARCHPARAMETER_NOTFOUND = Unable to find the base Search Parameter {0} so can''
SEARCHPARAMETER_BASE_WRONG = The resource type {1} is not listed as a base in the SearchParameter this is derived from ({0})
SEARCHPARAMETER_TYPE_WRONG = The type {1} is different to the type {0} in the derivedFrom SearchParameter
SEARCHPARAMETER_EXP_WRONG = The expression ''{2}'' is not compatible with the expression ''{1}'' in the derivedFrom SearchParameter {0}, and this likely indicates that the derivation relationship is not valid
SEARCHPARAMETER_MISSING_COMPONENTS = When the SearchParameter has a type of 'composite', then the SearchParameter must define two or more components
VALUESET_NO_SYSTEM_WARNING = No System specified, so Concepts and Filters can't be checked
VALUESET_INCLUDE_INVALID_CONCEPT_CODE = The code ''{1}'' is not valid in the system {0}
VALUESET_INCLUDE_INVALID_CONCEPT_CODE_VER = The code ''{2}'' is not valid in the system {0} version {1}
@ -728,7 +729,7 @@ SD_VALUE_TYPE_IILEGAL = The element {0} has a {1} of type {2}, which is not in t
SD_VALUE_TYPE_REPEAT_HINT = The repeating element has a {1}. The {1} will apply to all the repeats (this has not been clear to all users)
SD_VALUE_TYPE_REPEAT_WARNING_DOTNET = The repeating element has a {1} value for a primitive type. The DotNet validator will not apply this to all the repeats - this is an error
SD_NO_TYPES_OR_CONTENTREF = The element {0} has no assigned types, and no content reference
CODESYSTEM_CS_UNK_EXPANSION = The code provided ({2}) is not in the expansion in the value set {0}, and a code is required from this value set. The system {1} is unknown.
CODESYSTEM_CS_UNK_EXPANSION = The code provided ({2}) is not in the expansion in the value set {0}, and a code is required from this value set. The system {1} could not be found.
BUNDLE_SEARCH_NOSELF = SearchSet Bundles should have a self link that specifies what the search was
BUNDLE_SEARCH_SELF_NOT_UNDERSTOOD = No types could be determined from the search string, so the types can''t be checked
BUNDLE_SEARCH_ENTRY_NO_RESOURCE = SearchSet Bundle Entries must have resources
@ -917,13 +918,13 @@ CONCEPTMAP_GROUP_TARGET_PROPERTY_INVALID = The property code ''{0}'' is not know
CONCEPTMAP_GROUP_TARGET_PROPERTY_TYPE_MISMATCH = The type of this property should be {1} not {0}
CONCEPTMAP_GROUP_TARGET_PROPERTY_TYPE_NO_SYSTEM = Since no system has been provided, a plain code cannot be used
CONCEPTMAP_GROUP_TARGET_PROPERTY_CODE_INVALID = The code {0} is invalid in the system {1}
CONCEPTMAP_GROUP_TARGET_PROPERTY_TYPE_UNKNOWN_SYSTEM = The system {0} is unknown, so code values can''t be checked
CONCEPTMAP_GROUP_TARGET_PROPERTY_TYPE_UNKNOWN_SYSTEM = The code system {0} could not be found, so code values can''t be checked
SM_DEPENDENT_PARAM_TYPE_MISMATCH_DUPLICATE = The group {0} has already been used with different parameters, so the type checking may be incorrect (other = [{1}]; this = [{2}])
CONCEPTMAP_GROUP_SOURCE_INCOMPLETE = Source Code System {0} doesn''t have all content (content = {1}), so the source codes cannot be checked
CONCEPTMAP_GROUP_TARGET_INCOMPLETE = Target Code System {0} doesn''t have all content (content = {1}), so the target codes cannot be checked
SD_NO_TYPE_CODE_ON_CODE = Snapshot for {1} element {0} has type.code without a value
UNKNOWN_CODESYSTEM = The CodeSystem {0} is unknown
UNKNOWN_CODESYSTEM_VERSION = The CodeSystem {0} version {1} is unknown. Valid versions: {2}
UNKNOWN_CODESYSTEM = The code system {0} could not be found
UNKNOWN_CODESYSTEM_VERSION = The code system {0} version {1} could not be found. Valid versions: {2}
UNABLE_TO_INFER_CODESYSTEM = The System URI could not be determined for the code {0} in the ValueSet {1}
VALUESET_TOO_COSTLY = The value set {0} has too many codes to display ({1})
VALUESET_TOO_COSTLY_TIME = The value set {0} took too long to process (>{1}sec)
@ -1046,7 +1047,7 @@ VALUESET_CIRCULAR_REFERENCE = Found a circularity pointing to {0} processing Val
VALUESET_SUPPLEMENT_MISSING_one = Required supplement not found: {1}
VALUESET_SUPPLEMENT_MISSING_other = Required supplements not found: {1}
CONCEPTMAP_VS_TOO_MANY_CODES = The concept map has too many codes to validate ({0})
CONCEPTMAP_VS_CONCEPT_CODE_UNKNOWN_SYSTEM = The code ''{1}'' comes from the system {0} which is unknown, so it''s not known whether it''s valid in the value set ''{2}''
CONCEPTMAP_VS_CONCEPT_CODE_UNKNOWN_SYSTEM = The code ''{1}'' comes from the system {0} which could not be found, so it''s not known whether it''s valid in the value set ''{2}''
CONCEPTMAP_VS_INVALID_CONCEPT_CODE = The code ''{1}'' in the system {0} is not valid in the value set ''{2}''
CONCEPTMAP_VS_INVALID_CONCEPT_CODE_VER = The code ''{2}'' in the system {0} version {1} is not valid in the value set ''{3}''
VALUESET_INC_TOO_MANY_CODES = The value set include has too many codes to validate ({0})
@ -1085,3 +1086,5 @@ FHIRPATH_ARITHMETIC_MINUS = Error in date arithmetic: Unable to subtract type {0
BUNDLE_ENTRY_URL_MATCHES_NO_ID = The fullUrl ''{0}'' looks like a RESTful server URL, but the resource has no id
BUNDLE_ENTRY_URL_MATCHES_TYPE_ID = The fullUrl ''{0}'' looks like a RESTful server URL, so it must end with the correct type and id (/{1}/{2})
BUNDLE_ENTRY_URL_ABSOLUTE = The fullUrl must be an absolute URL (not ''{0}'')
FHIRPATH_COLLECTION_STATUS_PARAMETER = Parameter {1} is inherently a collection, and so the expression ''{0}'' may fail, create an error, or return false if there is more than one item in the parameter value ({2})
FHIRPATH_COLLECTION_STATUS_CONTEXT = The context is inherently a collection, and so the expression ''{0}'' may fail, create an error, or return false if there is more than one item in the context ({2})

View File

@ -28,6 +28,7 @@ import org.hl7.fhir.exceptions.DefinitionException;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r5.conformance.profile.ProfileUtilities;
import org.hl7.fhir.r5.context.ContextUtilities;
import org.hl7.fhir.r5.context.ILoggingService;
import org.hl7.fhir.r5.context.IWorkerContext;
import org.hl7.fhir.r5.context.IWorkerContextManager;
import org.hl7.fhir.r5.context.SimpleWorkerContext;
@ -324,7 +325,7 @@ public class ValidationEngine implements IValidatorResourceFetcher, IValidationP
private final boolean canRunWithoutTerminologyServer;
@With
private final IWorkerContext.ILoggingService loggingService;
private final ILoggingService loggingService;
@With
private boolean THO = true;
@ -342,7 +343,7 @@ public class ValidationEngine implements IValidatorResourceFetcher, IValidationP
loggingService = new SystemOutLoggingService();
}
public ValidationEngineBuilder(String terminologyCachePath, String userAgent, String version, String txServer, String txLog, FhirPublication txVersion, TimeTracker timeTracker, boolean canRunWithoutTerminologyServer, IWorkerContext.ILoggingService loggingService, boolean THO) {
public ValidationEngineBuilder(String terminologyCachePath, String userAgent, String version, String txServer, String txLog, FhirPublication txVersion, TimeTracker timeTracker, boolean canRunWithoutTerminologyServer, ILoggingService loggingService, boolean THO) {
this.terminologyCachePath = terminologyCachePath;
this.userAgent = userAgent;
this.version = version;
@ -431,7 +432,7 @@ public class ValidationEngine implements IValidatorResourceFetcher, IValidationP
*
* @see IgLoader#loadIgSource(String, boolean, boolean) loadIgSource for detailed description of the src parameter
*/
private void loadCoreDefinitions(String src, boolean recursive, String terminologyCachePath, String userAgent, TimeTracker tt, IWorkerContext.ILoggingService loggingService) throws FHIRException, IOException {
private void loadCoreDefinitions(String src, boolean recursive, String terminologyCachePath, String userAgent, TimeTracker tt, ILoggingService loggingService) throws FHIRException, IOException {
NpmPackage npm = getPcm().loadPackage(src, null);
if (npm != null) {
version = npm.fhirVersion();

View File

@ -5,10 +5,10 @@ import java.util.Date;
import java.util.List;
import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.utilities.VersionUtil;
import org.hl7.fhir.utilities.validation.ValidationMessage;
import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity;
import org.hl7.fhir.validation.ValidationRecord;
import org.hl7.fhir.validation.cli.utils.VersionUtil;
public class HTMLOutputGenerator {

View File

@ -2,6 +2,7 @@ package org.hl7.fhir.validation.cli.utils;
import org.hl7.fhir.utilities.FhirPublication;
import org.hl7.fhir.utilities.TimeTracker;
import org.hl7.fhir.utilities.VersionUtil;
import org.hl7.fhir.utilities.VersionUtilities;
import org.hl7.fhir.utilities.settings.FhirSettings;
import org.hl7.fhir.validation.ValidationEngine;

View File

@ -5,6 +5,7 @@ import java.io.InputStream;
import java.io.PrintStream;
import org.apache.commons.io.IOUtils;
import org.hl7.fhir.utilities.VersionUtil;
import org.hl7.fhir.utilities.npm.FilesystemPackageCacheManager;
/**

View File

@ -2219,7 +2219,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
ok = true;
} else if (en.equals("Resource") && container.isResource()) {
ok = true;
} else if (en.equals("CanonicalResource") && VersionUtilities.getExtendedCanonicalResourceNames(context.getVersion()).contains(stack.getLiteralPath())) {
} else if (en.equals("CanonicalResource") && containsAny(VersionUtilities.getExtendedCanonicalResourceNames(context.getVersion()), plist)) {
ok = true;
} else if (hasElementName(plist, en) && pu == null) {
ok = true;
@ -2310,6 +2310,15 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
}
}
private boolean containsAny(Set<String> set, List<String> list) {
for (String p : list) {
if (set.contains(p)) {
return true;
}
}
return false;
}
private boolean hasElementName(List<String> plist, String en) {
String[] ep = en.split("\\.");
for (String s : plist) {
@ -2726,7 +2735,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
if (dok) {
try {
DateTimeType dt = new DateTimeType(e.primitiveValue());
if (isCoreDefinition(profile) || (context.hasExtension(ToolingExtensions.EXT_DATE_RULES) && ToolingExtensions.readStringExtension(context, ToolingExtensions.EXT_DATE_RULES).contains("year-valid"))) {
if (isCoreDefinition(profile) || !context.hasExtension(ToolingExtensions.EXT_DATE_RULES) || ToolingExtensions.readStringExtension(context, ToolingExtensions.EXT_DATE_RULES).contains("year-valid")) {
warning(errors, NO_RULE_DATE, IssueType.INVALID, e.line(), e.col(), path, yearIsValid(e.primitiveValue()), I18nConstants.TYPE_SPECIFIC_CHECKS_DT_DATETIME_REASONABLE, e.primitiveValue());
}
} catch (Exception ex) {

View File

@ -633,7 +633,7 @@ public class BundleValidator extends BaseValidator {
for (EntrySummary e : entryList) {
List<StringWithSource> references = findReferences(e.getEntry());
for (StringWithSource ref : references) {
Element tgt = resolveInBundle(bundle, entries, ref.getReference(), e.getEntry().getChildValue(FULL_URL), e.getResource().fhirType(), e.getResource().getIdBase(), stack, errors, ref.getSource().getPath(), ref.getSource(), ref.isWarning());
Element tgt = resolveInBundle(bundle, entries, ref.getReference(), e.getEntry().getChildValue(FULL_URL), e.getResource().fhirType(), e.getResource().getIdBase(), stack, errors, ref.getSource().getPath(), ref.getSource(), ref.isWarning() || true);
if (tgt != null) {
EntrySummary t = entryForTarget(entryList, tgt);
if (t != null ) {

View File

@ -67,11 +67,18 @@ public class SearchParameterValidator extends BaseValidator {
String expThis = canonicalise(cs.getNamedChildValue("expression", false), bases);
String expOther = canonicalise(sp.getExpression(), bases);
warning(errors, NO_RULE_DATE, IssueType.BUSINESSRULE,stack.getLiteralPath(), expThis.equals(expOther), I18nConstants.SEARCHPARAMETER_EXP_WRONG, master, sp.getExpression(), cs.getNamedChildValue("expression", false));
}
// todo: check compositions
}
}
}
if ("composite".equals(cs.getNamedChildValue("type", false))) {
List<Element> components = cs.getChildren("component");
if (rule(errors, NO_RULE_DATE, IssueType.BUSINESSRULE, stack.getLiteralPath(), components.size() > 1, I18nConstants.SEARCHPARAMETER_MISSING_COMPONENTS)) {
// todo: check compositions
} else {
ok = false;
}
}
return ok;
}

View File

@ -50,7 +50,7 @@ public class LocalTerminologyServiceTests implements ITxTesterLoader {
private static boolean localTxRunning() {
return new File("/Users/grahamegrieve/work/server/serverx").exists();
return new File("/Users/grahamegrieve/work/server/server").exists();
}

View File

@ -2,8 +2,8 @@ package org.hl7.fhir.validation.cli.services;
import org.hl7.fhir.r5.context.IWorkerContext;
import org.hl7.fhir.r5.terminologies.client.ITerminologyClient;
import org.hl7.fhir.utilities.VersionUtil;
import org.hl7.fhir.utilities.npm.FilesystemPackageCacheManager;
import org.hl7.fhir.validation.cli.utils.VersionUtil;
import org.junit.Test;
import java.net.URISyntaxException;

View File

@ -30,12 +30,12 @@ import org.hl7.fhir.r5.elementmodel.Manager;
import org.hl7.fhir.r5.model.StructureDefinition;
import org.hl7.fhir.r5.test.utils.TestingUtilities;
import org.hl7.fhir.utilities.TimeTracker;
import org.hl7.fhir.utilities.VersionUtil;
import org.hl7.fhir.utilities.settings.FhirSettings;
import org.hl7.fhir.validation.ValidationEngine;
import org.hl7.fhir.validation.cli.model.CliContext;
import org.hl7.fhir.validation.cli.model.FileInfo;
import org.hl7.fhir.validation.cli.model.ValidationRequest;
import org.hl7.fhir.validation.cli.utils.VersionUtil;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;

View File

@ -22,6 +22,7 @@ import org.hl7.fhir.convertors.factory.VersionConvertorFactory_10_50;
import org.hl7.fhir.convertors.factory.VersionConvertorFactory_14_50;
import org.hl7.fhir.convertors.factory.VersionConvertorFactory_30_50;
import org.hl7.fhir.convertors.factory.VersionConvertorFactory_40_50;
import org.hl7.fhir.convertors.loaders.loaderR5.R4ToR5Loader;
import org.hl7.fhir.exceptions.DefinitionException;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.exceptions.FHIRFormatError;
@ -73,6 +74,7 @@ import org.hl7.fhir.utilities.VersionUtilities;
import org.hl7.fhir.utilities.json.JsonException;
import org.hl7.fhir.utilities.json.JsonTrackingParser;
import org.hl7.fhir.utilities.json.JsonUtilities;
import org.hl7.fhir.utilities.npm.FilesystemPackageCacheManager;
import org.hl7.fhir.utilities.npm.NpmPackage;
import org.hl7.fhir.utilities.settings.FhirSettings;
import org.hl7.fhir.utilities.tests.CacheVerificationLogger;
@ -80,6 +82,7 @@ import org.hl7.fhir.utilities.validation.IDigitalSignatureServices;
import org.hl7.fhir.utilities.validation.ValidationMessage;
import org.hl7.fhir.validation.IgLoader;
import org.hl7.fhir.validation.ValidationEngine;
import org.hl7.fhir.validation.ValidatorUtils;
import org.hl7.fhir.validation.cli.model.HtmlInMarkdownCheck;
import org.hl7.fhir.validation.cli.services.StandAloneValidatorFetcher;
import org.hl7.fhir.validation.instance.InstanceValidator;
@ -304,6 +307,28 @@ public class ValidationTests implements IEvaluationContext, IValidatorResourceFe
} else {
val.setDebug(false);
}
StructureDefinition sd = null;
if (content.has("ips")) {
val.setCheckIPSCodes(true);
val.getContext().loadFromPackage(loadPackage("hl7.fhir.uv.ips#1.1.0"), ValidatorUtils.loaderForVersion("4.0.1"));
if (content.get("ips").getAsString().equals("uv")) {
sd = val.getContext().fetchResource(StructureDefinition.class, "http://hl7.org/fhir/uv/ips/StructureDefinition/Bundle-uv-ips");
val.getBundleValidationRules().add(new BundleValidationRule().setRule("Composition:0").setProfile("http://hl7.org/fhir/uv/ips/StructureDefinition/Composition-uv-ips"));
} else if (content.get("ips").getAsString().equals("au")) {
val.getContext().loadFromPackage(loadPackage("hl7.fhir.au.base#current"), ValidatorUtils.loaderForVersion("4.0.1"));
val.getContext().loadFromPackage(loadPackage("hl7.fhir.au.core#current"), ValidatorUtils.loaderForVersion("4.0.1"));
val.getContext().loadFromPackage(loadPackage("hl7.fhir.au.ips#current"), ValidatorUtils.loaderForVersion("4.0.1"));
sd = val.getContext().fetchResource(StructureDefinition.class, "http://hl7.org.au/fhir/ips/StructureDefinition/Bundle-au-ips");
val.getBundleValidationRules().add(new BundleValidationRule().setRule("Composition:0").setProfile("http://hl7.org/fhir/uv/ips/StructureDefinition/Composition-uv-ips"));
} else if (content.get("ips").getAsString().equals("nz")) {
val.getContext().loadFromPackage(loadPackage("tewhatuora.fhir.nzps#current"), ValidatorUtils.loaderForVersion("4.0.1"));
sd = val.getContext().fetchResource(StructureDefinition.class, "https://standards.digital.health.nz/fhir/StructureDefinition/nzps-bundle");
val.getBundleValidationRules().add(new BundleValidationRule().setRule("Composition:0").setProfile("http://hl7.org/fhir/uv/ips/StructureDefinition/Composition-uv-ips"));
} else {
throw new Error("Unknown IPS "+content.get("ips").getAsString());
}
}
if (content.has("best-practice")) {
val.setBestPracticeWarningLevel(BestPracticeWarningLevel.valueOf(content.get("best-practice").getAsString()));
}
@ -356,7 +381,6 @@ public class ValidationTests implements IEvaluationContext, IValidatorResourceFe
}
}
}
StructureDefinition sd = null;
String filename = profile.get("source").getAsString();
if (Utilities.isAbsoluteUrl(filename)) {
sd = val.getContext().fetchResource(StructureDefinition.class, filename);
@ -398,7 +422,7 @@ public class ValidationTests implements IEvaluationContext, IValidatorResourceFe
}
List<StructureDefinition> profiles = new ArrayList<>();
if (logical.has("format")) {
StructureDefinition sd = val.getContext().fetchResource(StructureDefinition.class, JsonUtilities.str(logical, "format"));
sd = val.getContext().fetchResource(StructureDefinition.class, JsonUtilities.str(logical, "format"));
if (sd != null) {
profiles.add(sd);
} else {
@ -420,6 +444,11 @@ public class ValidationTests implements IEvaluationContext, IValidatorResourceFe
}
private NpmPackage loadPackage(String idAndVer) throws IOException {
var pcm = new FilesystemPackageCacheManager(true);
return pcm.loadPackage(idAndVer);
}
private ValidationEngine buildVersionEngine(String ver, String txLog) throws Exception {
String server = FhirSettings.getTxFhirDevelopment();
switch (ver) {

View File

@ -1509,7 +1509,6 @@ v: {
"code" : "276885007",
"system" : "http://snomed.info/sct",
"version" : "http://snomed.info/sct/900000000000207008/version/20230731",
"unknown-systems" : "",
"issues" : {
"resourceType" : "OperationOutcome"
}
@ -1530,6 +1529,666 @@ v: {
"code" : "Cel",
"system" : "http://unitsofmeasure.org",
"version" : "2.0.1",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"code" : "en-NZ"
}, "url": "http://hl7.org/fhir/ValueSet/languages", "version": "4.0.1", "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"true", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"code" : "en-NZ",
"system" : "urn:ietf:bcp:47",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"code" : "d"
}, "url": "http://hl7.org/fhir/ValueSet/units-of-time", "version": "4.0.1", "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"true", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"code" : "d",
"system" : "http://unitsofmeasure.org",
"version" : "2.0.1",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"code" : "Cel"
}, "url": "http://hl7.org/fhir/ValueSet/ucum-bodytemp", "version": "4.0.1", "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"true", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"code" : "Cel",
"system" : "http://unitsofmeasure.org",
"version" : "2.0.1",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"code" : "cm"
}, "url": "http://hl7.org/fhir/ValueSet/ucum-bodylength", "version": "4.0.1", "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"true", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"code" : "cm",
"system" : "http://unitsofmeasure.org",
"version" : "2.0.1",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"code" : "kg"
}, "url": "http://hl7.org/fhir/ValueSet/ucum-bodyweight", "version": "4.0.1", "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"true", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"code" : "kg",
"system" : "http://unitsofmeasure.org",
"version" : "2.0.1",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"code" : "NZ"
}, "url": "http://hl7.org/fhir/ValueSet/iso3166-1-2", "version": "4.0.1", "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"true", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"true", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"display" : "New Zealand",
"code" : "NZ",
"system" : "urn:iso:std:iso:3166",
"version" : "2018",
"unknown-systems" : "",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://snomed.info/sct",
"code" : "26643006"
}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"true", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"severity" : "error",
"error" : "The provided code 'http://snomed.info/sct#26643006' is not in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027' (from Tx-Server)",
"class" : "UNKNOWN",
"unknown-systems" : "",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://snomed.info/sct",
"code" : "767525000"
}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"true", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"severity" : "error",
"error" : "The provided code 'http://snomed.info/sct#767525000' is not in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027' (from Tx-Server)",
"class" : "UNKNOWN",
"unknown-systems" : "",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://snomed.info/sct",
"code" : "237599002"
}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"true", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"code" : "237599002",
"system" : "http://snomed.info/sct",
"version" : "http://snomed.info/sct/900000000000207008/version/20230131",
"unknown-systems" : "",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://snomed.info/sct",
"code" : "1201005"
}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"true", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"code" : "1201005",
"system" : "http://snomed.info/sct",
"version" : "http://snomed.info/sct/900000000000207008/version/20230131",
"unknown-systems" : "",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://snomed.info/sct",
"code" : "109081006"
}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"true", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"severity" : "error",
"error" : "The provided code 'http://snomed.info/sct#109081006' is not in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027' (from Tx-Server)",
"class" : "UNKNOWN",
"unknown-systems" : "",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://snomed.info/sct",
"code" : "5913000"
}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"true", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"code" : "5913000",
"system" : "http://snomed.info/sct",
"version" : "http://snomed.info/sct/900000000000207008/version/20230131",
"unknown-systems" : "",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://snomed.info/sct",
"code" : "292954005"
}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"true", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"severity" : "error",
"error" : "The provided code 'http://snomed.info/sct#292954005' is not in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027' (from Tx-Server)",
"class" : "UNKNOWN",
"unknown-systems" : "",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://snomed.info/sct",
"code" : "52910006"
}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"true", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"code" : "52910006",
"system" : "http://snomed.info/sct",
"version" : "http://snomed.info/sct/900000000000207008/version/20230131",
"unknown-systems" : "",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://snomed.info/sct",
"code" : "428673006"
}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"true", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"severity" : "error",
"error" : "The provided code 'http://snomed.info/sct#428673006' is not in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027' (from Tx-Server)",
"class" : "UNKNOWN",
"unknown-systems" : "",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://snomed.info/sct",
"code" : "265132005"
}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"true", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"code" : "265132005",
"system" : "http://snomed.info/sct",
"version" : "http://snomed.info/sct/900000000000207008/version/20230131",
"unknown-systems" : "",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://snomed.info/sct",
"code" : "7947003"
}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"true", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"severity" : "error",
"error" : "The provided code 'http://snomed.info/sct#7947003' is not in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027' (from Tx-Server)",
"class" : "UNKNOWN",
"unknown-systems" : "",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://snomed.info/sct",
"code" : "81464008"
}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"true", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"severity" : "error",
"error" : "The provided code 'http://snomed.info/sct#81464008' is not in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027' (from Tx-Server)",
"class" : "UNKNOWN",
"unknown-systems" : "",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://snomed.info/sct",
"code" : "48546005"
}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"true", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"severity" : "error",
"error" : "The provided code 'http://snomed.info/sct#48546005' is not in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027' (from Tx-Server)",
"class" : "UNKNOWN",
"unknown-systems" : "",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://snomed.info/sct",
"code" : "40425004"
}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"true", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"code" : "40425004",
"system" : "http://snomed.info/sct",
"version" : "http://snomed.info/sct/900000000000207008/version/20230131",
"unknown-systems" : "",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://snomed.info/sct",
"code" : "158965000"
}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"true", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"severity" : "error",
"error" : "The provided code 'http://snomed.info/sct#158965000' is not in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027' (from Tx-Server)",
"class" : "UNKNOWN",
"unknown-systems" : "",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://snomed.info/sct",
"code" : "96309000"
}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"true", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"severity" : "error",
"error" : "The provided code 'http://snomed.info/sct#96309000' is not in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027' (from Tx-Server)",
"class" : "UNKNOWN",
"unknown-systems" : "",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://snomed.info/sct",
"code" : "714081009"
}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"true", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"severity" : "error",
"error" : "The provided code 'http://snomed.info/sct#714081009' is not in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027' (from Tx-Server)",
"class" : "UNKNOWN",
"unknown-systems" : "",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://snomed.info/sct",
"code" : "25246002"
}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"true", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"severity" : "error",
"error" : "The provided code 'http://snomed.info/sct#25246002' is not in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027' (from Tx-Server)",
"class" : "UNKNOWN",
"unknown-systems" : "",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://snomed.info/sct",
"code" : "96067005"
}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"true", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"severity" : "error",
"error" : "The provided code 'http://snomed.info/sct#96067005' is not in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027' (from Tx-Server)",
"class" : "UNKNOWN",
"unknown-systems" : "",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://snomed.info/sct",
"code" : "90560007"
}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"true", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"code" : "90560007",
"system" : "http://snomed.info/sct",
"version" : "http://snomed.info/sct/900000000000207008/version/20230131",
"unknown-systems" : "",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://snomed.info/sct",
"code" : "34206005"
}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"true", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"severity" : "error",
"error" : "The provided code 'http://snomed.info/sct#34206005' is not in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027' (from Tx-Server)",
"class" : "UNKNOWN",
"unknown-systems" : "",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://snomed.info/sct",
"code" : "108537001"
}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"true", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"severity" : "error",
"error" : "The provided code 'http://snomed.info/sct#108537001' is not in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027' (from Tx-Server)",
"class" : "UNKNOWN",
"unknown-systems" : "",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://snomed.info/sct",
"code" : "126212009"
}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"true", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"severity" : "error",
"error" : "The provided code 'http://snomed.info/sct#126212009' is not in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027' (from Tx-Server)",
"class" : "UNKNOWN",
"unknown-systems" : "",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://snomed.info/sct",
"code" : "292360004"
}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"true", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"severity" : "error",
"error" : "The provided code 'http://snomed.info/sct#292360004' is not in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027' (from Tx-Server)",
"class" : "UNKNOWN",
"unknown-systems" : "",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://snomed.info/sct",
"code" : "16217701000119102"
}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"true", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"severity" : "error",
"error" : "The provided code 'http://snomed.info/sct#16217701000119102' is not in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027' (from Tx-Server)",
"class" : "UNKNOWN",
"unknown-systems" : "",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://snomed.info/sct",
"code" : "287903004"
}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"true", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"severity" : "error",
"error" : "The provided code 'http://snomed.info/sct#287903004' is not in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027' (from Tx-Server)",
"class" : "UNKNOWN",
"unknown-systems" : "",
"issues" : {
"resourceType" : "OperationOutcome"

View File

@ -350,7 +350,6 @@ v: {
"code" : "210",
"system" : "http://hl7.org/fhir/sid/cvx",
"version" : "20210406",
"unknown-systems" : "",
"issues" : {
"resourceType" : "OperationOutcome"
}
@ -372,6 +371,225 @@ v: {
"code" : "207",
"system" : "http://hl7.org/fhir/sid/cvx",
"version" : "20210406",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://hl7.org/fhir/sid/cvx",
"code" : "208",
"display" : "SARS-COV-2 (COVID-19) vaccine, mRNA, spike protein, LNP, preservative free, 30 mcg/0.3mL dose"
}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"code" : "208",
"system" : "http://hl7.org/fhir/sid/cvx",
"version" : "20210406",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://hl7.org/fhir/sid/cvx",
"code" : "141",
"display" : "Influenza, seasonal, injectable"
}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"code" : "141",
"system" : "http://hl7.org/fhir/sid/cvx",
"version" : "20210406",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://hl7.org/fhir/sid/cvx",
"code" : "20",
"display" : "diphtheria, tetanus toxoids and acellular pertussis vaccine"
}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"code" : "20",
"system" : "http://hl7.org/fhir/sid/cvx",
"version" : "20210406",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://hl7.org/fhir/sid/cvx",
"code" : "138",
"display" : "tetanus and diphtheria toxoids, not adsorbed, for adult use"
}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"code" : "138",
"system" : "http://hl7.org/fhir/sid/cvx",
"version" : "20210406",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://hl7.org/fhir/sid/cvx",
"code" : "133",
"display" : "pneumococcal conjugate vaccine, 13 valent"
}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"code" : "133",
"system" : "http://hl7.org/fhir/sid/cvx",
"version" : "20210406",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://hl7.org/fhir/sid/cvx",
"code" : "208",
"display" : "SARS-COV-2 (COVID-19) vaccine, mRNA, spike protein, LNP, preservative free, 30 mcg/0.3mL dose"
}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"display" : "SARS-COV-2 (COVID-19) vaccine, mRNA, spike protein, LNP, preservative free, 30 mcg/0.3mL dose",
"code" : "208",
"system" : "http://hl7.org/fhir/sid/cvx",
"version" : "20210406",
"unknown-systems" : "",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://hl7.org/fhir/sid/cvx",
"code" : "141",
"display" : "Influenza, seasonal, injectable"
}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"display" : "Influenza, seasonal, injectable",
"code" : "141",
"system" : "http://hl7.org/fhir/sid/cvx",
"version" : "20210406",
"unknown-systems" : "",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://hl7.org/fhir/sid/cvx",
"code" : "20",
"display" : "diphtheria, tetanus toxoids and acellular pertussis vaccine"
}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"display" : "diphtheria, tetanus toxoids and acellular pertussis vaccine",
"code" : "20",
"system" : "http://hl7.org/fhir/sid/cvx",
"version" : "20210406",
"unknown-systems" : "",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://hl7.org/fhir/sid/cvx",
"code" : "138",
"display" : "tetanus and diphtheria toxoids, not adsorbed, for adult use"
}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"display" : "tetanus and diphtheria toxoids, not adsorbed, for adult use",
"code" : "138",
"system" : "http://hl7.org/fhir/sid/cvx",
"version" : "20210406",
"unknown-systems" : "",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://hl7.org/fhir/sid/cvx",
"code" : "133",
"display" : "pneumococcal conjugate vaccine, 13 valent"
}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"display" : "pneumococcal conjugate vaccine, 13 valent",
"code" : "133",
"system" : "http://hl7.org/fhir/sid/cvx",
"version" : "20210406",
"unknown-systems" : "",
"issues" : {
"resourceType" : "OperationOutcome"

View File

@ -618,6 +618,187 @@ v: {
"severity" : "error",
"error" : "The provided code 'http://unitsofmeasure.org#mm[Hg]{hg}' is not in the value set 'http://hl7.org/fhir/ValueSet/ucum-vitals-common--0|4.0.1' (from Tx-Server)",
"class" : "UNKNOWN",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://unitsofmeasure.org",
"code" : "mmol/L"
}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"code" : "mmol/L",
"system" : "http://unitsofmeasure.org",
"version" : "2.0.1",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://unitsofmeasure.org",
"code" : "mmol/mol"
}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"code" : "mmol/mol",
"system" : "http://unitsofmeasure.org",
"version" : "2.0.1",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://unitsofmeasure.org",
"code" : "Cel"
}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"code" : "Cel",
"system" : "http://unitsofmeasure.org",
"version" : "2.0.1",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://unitsofmeasure.org",
"code" : "/min"
}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"code" : "/min",
"system" : "http://unitsofmeasure.org",
"version" : "2.0.1",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://unitsofmeasure.org",
"code" : "mm[Hg]"
}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"code" : "mm[Hg]",
"system" : "http://unitsofmeasure.org",
"version" : "2.0.1",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://unitsofmeasure.org",
"code" : "mm[Hg]"
}, "url": "http://hl7.org/fhir/ValueSet/ucum-vitals-common--0", "version": "4.0.1", "langs":"en-NZ", "useServer":"true", "useClient":"false", "guessSystem":"false", "valueSetMode":"CHECK_MEMERSHIP_ONLY", "displayWarningMode":"false", "versionFlexible":"false", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"code" : "mm[Hg]",
"system" : "http://unitsofmeasure.org",
"version" : "2.0.1",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://unitsofmeasure.org",
"code" : "cm"
}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"code" : "cm",
"system" : "http://unitsofmeasure.org",
"version" : "2.0.1",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://unitsofmeasure.org",
"code" : "kg"
}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"code" : "kg",
"system" : "http://unitsofmeasure.org",
"version" : "2.0.1",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://unitsofmeasure.org",
"code" : "mmol/mol"
}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"display" : "mmol/mol",
"code" : "mmol/mol",
"system" : "http://unitsofmeasure.org",
"version" : "2.0.1",
"unknown-systems" : "",
"issues" : {
"resourceType" : "OperationOutcome"

View File

@ -20,7 +20,7 @@
<properties>
<guava_version>32.0.1-jre</guava_version>
<hapi_fhir_version>6.4.1</hapi_fhir_version>
<validator_test_case_version>1.4.17</validator_test_case_version>
<validator_test_case_version>1.4.18-SNAPSHOT</validator_test_case_version>
<jackson_version>2.15.2</jackson_version>
<junit_jupiter_version>5.9.2</junit_jupiter_version>
<junit_platform_launcher_version>1.8.2</junit_platform_launcher_version>