mirror of
https://github.com/hapifhir/org.hl7.fhir.core.git
synced 2025-02-09 06:14:45 +00:00
whatever I really hate git
This commit is contained in:
commit
36ea3f5b45
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>org.hl7.fhir.core</artifactId>
|
||||
<version>5.5.9-SNAPSHOT</version>
|
||||
<version>5.5.10-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -79,7 +79,7 @@ public class VersionConvertorContext<T> {
|
||||
stack = new Stack<>();
|
||||
}
|
||||
stack.push(path);
|
||||
logger.debug("Pushing path <" + path + "> onto stack. Current path -> " + String.join(",", stack));
|
||||
// logger.debug("Pushing path <" + path + "> onto stack. Current path -> " + String.join(",", stack));
|
||||
threadLocalPath.set(stack);
|
||||
}
|
||||
|
||||
@ -96,7 +96,7 @@ public class VersionConvertorContext<T> {
|
||||
throw new FHIRException("Cannot close path <" + path + ">. Reached unstable state, no stack path available.");
|
||||
}
|
||||
String currentPath = stack.pop();
|
||||
logger.debug("Popping path <" + currentPath + "> off stack. Current path -> " + String.join(",", stack));
|
||||
// logger.debug("Popping path <" + currentPath + "> off stack. Current path -> " + String.join(",", stack));
|
||||
if (!path.equals(currentPath)) {
|
||||
throw new FHIRException("Reached unstable state, current path doesn't match expected path.");
|
||||
}
|
||||
@ -127,7 +127,7 @@ public class VersionConvertorContext<T> {
|
||||
public T getVersionConvertor() {
|
||||
T result = threadLocalVersionConverter.get();
|
||||
if (result != null && logger != null) {
|
||||
logger.debug(result.toString());
|
||||
// logger.debug(result.toString());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -36,6 +36,7 @@ public class DicomPackageBuilder {
|
||||
private String version;
|
||||
private String dest;
|
||||
private String source;
|
||||
private String pattern = "fhir.dicom#{version}.tgz";
|
||||
|
||||
public static void main(String[] args) throws FileNotFoundException, ParserConfigurationException, SAXException, IOException {
|
||||
if (args.length == 0 || args[0].equals("-help")) {
|
||||
@ -55,12 +56,16 @@ public class DicomPackageBuilder {
|
||||
DicomPackageBuilder self = new DicomPackageBuilder();
|
||||
self.setSource(source);
|
||||
self.setDest(dest);
|
||||
self.setPattern("{version}/package.tgz");
|
||||
self.execute();
|
||||
}
|
||||
|
||||
private void execute() throws FileNotFoundException, ParserConfigurationException, SAXException, IOException {
|
||||
public void execute() throws FileNotFoundException, ParserConfigurationException, SAXException, IOException {
|
||||
CodeSystem cs = buildCodeSystem();
|
||||
NPMPackageGenerator gen = new NPMPackageGenerator(Utilities.path(dest, "fhir.dicom#"+version+".tgz"), buildPackage());
|
||||
String fn = Utilities.path(dest, pattern.replace("{version}", version));
|
||||
Utilities.createDirectory(Utilities.getDirectoryForFile(fn));
|
||||
|
||||
NPMPackageGenerator gen = new NPMPackageGenerator(fn, buildPackage());
|
||||
int i = 2;
|
||||
gen.addFile(Category.RESOURCE, "CodeSystem-"+cs.getId()+".json", new JsonParser().setOutputStyle(OutputStyle.NORMAL).composeBytes(cs));
|
||||
ValueSet vs = buildAllValueSet();
|
||||
@ -168,15 +173,16 @@ public class DicomPackageBuilder {
|
||||
return p[0].substring(0, 4)+"."+(1+(p[0].charAt(4) - 'a'))+"."+p[1];
|
||||
}
|
||||
|
||||
private void setVersion(String version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
private void setDest(String dest) {
|
||||
public void setDest(String dest) {
|
||||
this.dest = dest;
|
||||
}
|
||||
|
||||
private void setSource(String source) {
|
||||
public void setSource(String source) {
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
public void setPattern(String pattern) {
|
||||
this.pattern = pattern;
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>org.hl7.fhir.core</artifactId>
|
||||
<version>5.5.9-SNAPSHOT</version>
|
||||
<version>5.5.10-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>org.hl7.fhir.core</artifactId>
|
||||
<version>5.5.9-SNAPSHOT</version>
|
||||
<version>5.5.10-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>org.hl7.fhir.core</artifactId>
|
||||
<version>5.5.9-SNAPSHOT</version>
|
||||
<version>5.5.10-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>org.hl7.fhir.core</artifactId>
|
||||
<version>5.5.9-SNAPSHOT</version>
|
||||
<version>5.5.10-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>org.hl7.fhir.core</artifactId>
|
||||
<version>5.5.9-SNAPSHOT</version>
|
||||
<version>5.5.10-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>org.hl7.fhir.core</artifactId>
|
||||
<version>5.5.9-SNAPSHOT</version>
|
||||
<version>5.5.10-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>org.hl7.fhir.core</artifactId>
|
||||
<version>5.5.9-SNAPSHOT</version>
|
||||
<version>5.5.10-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>org.hl7.fhir.core</artifactId>
|
||||
<version>5.5.9-SNAPSHOT</version>
|
||||
<version>5.5.10-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>org.hl7.fhir.core</artifactId>
|
||||
<version>5.5.9-SNAPSHOT</version>
|
||||
<version>5.5.10-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -5384,57 +5384,76 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
|
||||
// this is a hack work around for past publication of wrong FHIRPath expressions
|
||||
// R4
|
||||
// waiting for 4.0.2
|
||||
//TODO is this expression below correct? @grahamegrieve
|
||||
if ("probability is decimal implies (probability as decimal) <= 100".equals(expr)) {
|
||||
return "probablility.empty() or ((probability is decimal) implies ((probability as decimal) <= 100))";
|
||||
}
|
||||
|
||||
if ("enableWhen.count() > 2 implies enableBehavior.exists()".equals(expr)) {
|
||||
return "enableWhen.count() >= 2 implies enableBehavior.exists()";
|
||||
}
|
||||
|
||||
if ("txt-2".equals(key)) {
|
||||
return "htmlChecks2()";
|
||||
}
|
||||
|
||||
// handled in 4.0.1
|
||||
if ("(component.empty() and hasMember.empty()) implies (dataAbsentReason or value)".equals(expr))
|
||||
if ("(component.empty() and hasMember.empty()) implies (dataAbsentReason or value)".equals(expr)) {
|
||||
return "(component.empty() and hasMember.empty()) implies (dataAbsentReason.exists() or value.exists())";
|
||||
if ("isModifier implies isModifierReason.exists()".equals(expr))
|
||||
}
|
||||
if ("isModifier implies isModifierReason.exists()".equals(expr)) {
|
||||
return "(isModifier.exists() and isModifier) implies isModifierReason.exists()";
|
||||
if ("(%resource.kind = 'logical' or element.first().path.startsWith(%resource.type)) and (element.tail().not() or element.tail().all(path.startsWith(%resource.differential.element.first().path.replaceMatches('\\\\..*','')&'.')))".equals(expr))
|
||||
}
|
||||
if ("(%resource.kind = 'logical' or element.first().path.startsWith(%resource.type)) and (element.tail().not() or element.tail().all(path.startsWith(%resource.differential.element.first().path.replaceMatches('\\\\..*','')&'.')))".equals(expr)) {
|
||||
return "(%resource.kind = 'logical' or element.first().path.startsWith(%resource.type)) and (element.tail().empty() or element.tail().all(path.startsWith(%resource.differential.element.first().path.replaceMatches('\\\\..*','')&'.')))";
|
||||
if ("differential.element.all(id) and differential.element.id.trace('ids').isDistinct()".equals(expr))
|
||||
}
|
||||
if ("differential.element.all(id) and differential.element.id.trace('ids').isDistinct()".equals(expr)) {
|
||||
return "differential.element.all(id.exists()) and differential.element.id.trace('ids').isDistinct()";
|
||||
if ("snapshot.element.all(id) and snapshot.element.id.trace('ids').isDistinct()".equals(expr))
|
||||
}
|
||||
if ("snapshot.element.all(id) and snapshot.element.id.trace('ids').isDistinct()".equals(expr)) {
|
||||
return "snapshot.element.all(id.exists()) and snapshot.element.id.trace('ids').isDistinct()";
|
||||
}
|
||||
|
||||
// R3
|
||||
if ("(code or value.empty()) and (system.empty() or system = 'urn:iso:std:iso:4217')".equals(expr))
|
||||
if ("(code or value.empty()) and (system.empty() or system = 'urn:iso:std:iso:4217')".equals(expr)) {
|
||||
return "(code.exists() or value.empty()) and (system.empty() or system = 'urn:iso:std:iso:4217')";
|
||||
if ("value.empty() or code!=component.code".equals(expr))
|
||||
}
|
||||
if ("value.empty() or code!=component.code".equals(expr)) {
|
||||
return "value.empty() or (code in component.code).not()";
|
||||
if ("(code or value.empty()) and (system.empty() or system = %ucum) and (value.empty() or value > 0)".equals(expr))
|
||||
}
|
||||
if ("(code or value.empty()) and (system.empty() or system = %ucum) and (value.empty() or value > 0)".equals(expr)) {
|
||||
return "(code.exists() or value.empty()) and (system.empty() or system = %ucum) and (value.empty() or value > 0)";
|
||||
if ("element.all(definition and min and max)".equals(expr))
|
||||
}
|
||||
if ("element.all(definition and min and max)".equals(expr)) {
|
||||
return "element.all(definition.exists() and min.exists() and max.exists())";
|
||||
if ("telecom or endpoint".equals(expr))
|
||||
}
|
||||
if ("telecom or endpoint".equals(expr)) {
|
||||
return "telecom.exists() or endpoint.exists()";
|
||||
if ("(code or value.empty()) and (system.empty() or system = %ucum) and (value.empty() or value > 0)".equals(expr))
|
||||
}
|
||||
if ("(code or value.empty()) and (system.empty() or system = %ucum) and (value.empty() or value > 0)".equals(expr)) {
|
||||
return "(code.exists() or value.empty()) and (system.empty() or system = %ucum) and (value.empty() or value > 0)";
|
||||
if ("searchType implies type = 'string'".equals(expr))
|
||||
}
|
||||
if ("searchType implies type = 'string'".equals(expr)) {
|
||||
return "searchType.exists() implies type = 'string'";
|
||||
if ("abatement.empty() or (abatement as boolean).not() or clinicalStatus='resolved' or clinicalStatus='remission' or clinicalStatus='inactive'".equals(expr))
|
||||
}
|
||||
if ("abatement.empty() or (abatement as boolean).not() or clinicalStatus='resolved' or clinicalStatus='remission' or clinicalStatus='inactive'".equals(expr)) {
|
||||
return "abatement.empty() or (abatement is boolean).not() or (abatement as boolean).not() or (clinicalStatus = 'resolved') or (clinicalStatus = 'remission') or (clinicalStatus = 'inactive')";
|
||||
if ("(component.empty() and related.empty()) implies (dataAbsentReason or value)".equals(expr))
|
||||
}
|
||||
if ("(component.empty() and related.empty()) implies (dataAbsentReason or value)".equals(expr)) {
|
||||
return "(component.empty() and related.empty()) implies (dataAbsentReason.exists() or value.exists())";
|
||||
|
||||
}
|
||||
if ("reference.startsWith('#').not() or (reference.substring(1).trace('url') in %rootResource.contained.id.trace('ids'))".equals(expr)) {
|
||||
return "(reference = '#') or reference.startsWith('#').not() or (reference.substring(1).trace('url') in %rootResource.contained.id.trace('ids'))";
|
||||
}
|
||||
if ("reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))".equals(expr)) {
|
||||
return "(reference = '#') or reference.startsWith('#').not() or (reference.substring(1).trace('url') in %rootResource.contained.id.trace('ids'))";
|
||||
}
|
||||
if ("".equals(expr))
|
||||
if ("probability is decimal implies probability.as(decimal) <= 100".equals(expr)) {
|
||||
if (key.equals("ras-2")) {
|
||||
return "probability.empty() or (probability is decimal implies probability.as(decimal) <= 100)";
|
||||
}
|
||||
}
|
||||
if ("".equals(expr)) {
|
||||
return "";
|
||||
}
|
||||
return expr;
|
||||
}
|
||||
|
||||
|
@ -100,7 +100,6 @@ public class ValidationTests implements IEvaluationContext, IValidatorResourceFe
|
||||
|
||||
List<Object[]> objects = new ArrayList<Object[]>(examples.size());
|
||||
for (String id : names) {
|
||||
//if (id.equals("bundle-documentation-miss-last-updated"))
|
||||
objects.add(new Object[]{id, examples.get(id)});
|
||||
}
|
||||
return objects;
|
||||
|
4
pom.xml
4
pom.xml
@ -14,12 +14,12 @@
|
||||
HAPI FHIR
|
||||
-->
|
||||
<artifactId>org.hl7.fhir.core</artifactId>
|
||||
<version>5.5.9-SNAPSHOT</version>
|
||||
<version>5.5.10-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<properties>
|
||||
<hapi_fhir_version>5.1.0</hapi_fhir_version>
|
||||
<validator_test_case_version>1.1.71-SNAPSHOT</validator_test_case_version>
|
||||
<validator_test_case_version>1.1.72-SNAPSHOT</validator_test_case_version>
|
||||
<junit_jupiter_version>5.7.1</junit_jupiter_version>
|
||||
<junit_platform_launcher_version>1.7.1</junit_platform_launcher_version>
|
||||
<maven_surefire_version>3.0.0-M4</maven_surefire_version>
|
||||
|
Loading…
x
Reference in New Issue
Block a user