Mentions légales du service

Skip to content
Snippets Groups Projects
Commit fc20822c authored by Achraf Achkari's avatar Achraf Achkari
Browse files

Merge branch 'bugFixDgsante' into eHDSI-3.0

# Conflicts:
#	hl7templates/hl7templates-api-jar/src/main/java/net/ihe/gazelle/tempapi/impl/ChoiceDefinitionProcessorImpl.java
parents f91f2f10 42741abe
No related branches found
No related tags found
2 merge requests!30Develop,!27E hdsi 3.0
Showing
with 66 additions and 37 deletions
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<parent> <parent>
<artifactId>gazelle-objects-checker</artifactId> <artifactId>gazelle-objects-checker</artifactId>
<groupId>net.ihe.gazelle</groupId> <groupId>net.ihe.gazelle</groupId>
<version>3.0.4-SNAPSHOT</version> <version>3.0.5-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<groupId>net.ihe.gazelle.goc</groupId> <groupId>net.ihe.gazelle.goc</groupId>
<artifactId>generated-validator</artifactId> <artifactId>generated-validator</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>3.0.4-SNAPSHOT</version> <version>3.0.5-SNAPSHOT</version>
<modules> <modules>
<module>validator-archetype-instantiator</module> <module>validator-archetype-instantiator</module>
<module>validator-archetype</module> <module>validator-archetype</module>
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
<dependency> <dependency>
<groupId>net.ihe.gazelle.goctests</groupId> <groupId>net.ihe.gazelle.goctests</groupId>
<artifactId>goc-annotations</artifactId> <artifactId>goc-annotations</artifactId>
<version>3.0.4-SNAPSHOT</version> <version>3.0.5-SNAPSHOT</version>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>
...@@ -3,12 +3,12 @@ ...@@ -3,12 +3,12 @@
<parent> <parent>
<artifactId>generated-validator</artifactId> <artifactId>generated-validator</artifactId>
<groupId>net.ihe.gazelle.goc</groupId> <groupId>net.ihe.gazelle.goc</groupId>
<version>3.0.4-SNAPSHOT</version> <version>3.0.5-SNAPSHOT</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>validator-archetype-instantiator</artifactId> <artifactId>validator-archetype-instantiator</artifactId>
<version>3.0.4-SNAPSHOT</version> <version>3.0.5-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
</project> </project>
\ No newline at end of file
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
<parent> <parent>
<artifactId>generated-validator</artifactId> <artifactId>generated-validator</artifactId>
<groupId>net.ihe.gazelle.goc</groupId> <groupId>net.ihe.gazelle.goc</groupId>
<version>3.0.4-SNAPSHOT</version> <version>3.0.5-SNAPSHOT</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>validator-archetype</artifactId> <artifactId>validator-archetype</artifactId>
<version>3.0.4-SNAPSHOT</version> <version>3.0.5-SNAPSHOT</version>
<packaging>maven-archetype</packaging> <packaging>maven-archetype</packaging>
<build> <build>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<parent> <parent>
<artifactId>goc-tests</artifactId> <artifactId>goc-tests</artifactId>
<groupId>net.ihe.gazelle</groupId> <groupId>net.ihe.gazelle</groupId>
<version>3.0.4-SNAPSHOT</version> <version>3.0.5-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<groupId>net.ihe.gazelle.goctests</groupId> <groupId>net.ihe.gazelle.goctests</groupId>
<artifactId>goc-annotations</artifactId> <artifactId>goc-annotations</artifactId>
<name>GOC Annotations</name> <name>GOC Annotations</name>
<version>3.0.4-SNAPSHOT</version> <version>3.0.5-SNAPSHOT</version>
<build> <build>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<parent> <parent>
<artifactId>goc-tests</artifactId> <artifactId>goc-tests</artifactId>
<groupId>net.ihe.gazelle</groupId> <groupId>net.ihe.gazelle</groupId>
<version>3.0.4-SNAPSHOT</version> <version>3.0.5-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<groupId>net.ihe.gazelle.goctests</groupId> <groupId>net.ihe.gazelle.goctests</groupId>
<artifactId>goc-tests-runner</artifactId> <artifactId>goc-tests-runner</artifactId>
<name>GOC Tests Runner</name> <name>GOC Tests Runner</name>
<version>3.0.4-SNAPSHOT</version> <version>3.0.5-SNAPSHOT</version>
<build> <build>
...@@ -110,7 +110,7 @@ ...@@ -110,7 +110,7 @@
<dependency> <dependency>
<groupId>net.ihe.gazelle</groupId> <groupId>net.ihe.gazelle</groupId>
<artifactId>hl7templates-packager-jar</artifactId> <artifactId>hl7templates-packager-jar</artifactId>
<version>3.0.4-SNAPSHOT</version> <version>3.0.5-SNAPSHOT</version>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>
...@@ -7,6 +7,7 @@ import org.junit.Ignore; ...@@ -7,6 +7,7 @@ import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
import java.io.BufferedInputStream; import java.io.BufferedInputStream;
import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.net.MalformedURLException; import java.net.MalformedURLException;
...@@ -27,7 +28,7 @@ public class ValidatorGeneratorTest { ...@@ -27,7 +28,7 @@ public class ValidatorGeneratorTest {
String output = "[YOUR CDA PATH]"; String output = "[YOUR CDA PATH]";
String mvn = "[YOUR MVN PATH]"; String mvn = "[YOUR MVN PATH]";
try { try {
GeneratedValidator validator = validatorGenerator.generateValidator(new URL(bbr),output,mvn); GeneratedValidator validator = validatorGenerator.generateValidator(new File(bbr).toURI().toURL(),output,mvn);
org.junit.Assert.assertTrue(validator.getValidatorBinaryPath() != null); org.junit.Assert.assertTrue(validator.getValidatorBinaryPath() != null);
System.out.println(validator); System.out.println(validator);
} catch (ValidatorGenerationException | MalformedURLException e) { } catch (ValidatorGenerationException | MalformedURLException e) {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<parent> <parent>
<artifactId>gazelle-objects-checker</artifactId> <artifactId>gazelle-objects-checker</artifactId>
<groupId>net.ihe.gazelle</groupId> <groupId>net.ihe.gazelle</groupId>
<version>3.0.4-SNAPSHOT</version> <version>3.0.5-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<groupId>net.ihe.gazelle</groupId> <groupId>net.ihe.gazelle</groupId>
<artifactId>goc-tests</artifactId> <artifactId>goc-tests</artifactId>
<name>GOC Tests</name> <name>GOC Tests</name>
<version>3.0.4-SNAPSHOT</version> <version>3.0.5-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<parent> <parent>
<artifactId>gazelle-objects-checker</artifactId> <artifactId>gazelle-objects-checker</artifactId>
<groupId>net.ihe.gazelle</groupId> <groupId>net.ihe.gazelle</groupId>
<version>3.0.4-SNAPSHOT</version> <version>3.0.5-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<groupId>net.ihe.gazelle</groupId> <groupId>net.ihe.gazelle</groupId>
<artifactId>gocmodel-jar</artifactId> <artifactId>gocmodel-jar</artifactId>
<name>GOC Model JAR</name> <name>GOC Model JAR</name>
<version>3.0.4-SNAPSHOT</version> <version>3.0.5-SNAPSHOT</version>
<organization> <organization>
<name>IHE-Europe</name> <name>IHE-Europe</name>
...@@ -337,7 +337,7 @@ ...@@ -337,7 +337,7 @@
<dependency> <dependency>
<groupId>net.ihe.gazelle.goctests</groupId> <groupId>net.ihe.gazelle.goctests</groupId>
<artifactId>goc-annotations</artifactId> <artifactId>goc-annotations</artifactId>
<version>3.0.4-SNAPSHOT</version> <version>3.0.5-SNAPSHOT</version>
</dependency> </dependency>
</dependencies> </dependencies>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<parent> <parent>
<artifactId>gazelle-objects-checker</artifactId> <artifactId>gazelle-objects-checker</artifactId>
<groupId>net.ihe.gazelle</groupId> <groupId>net.ihe.gazelle</groupId>
<version>3.0.4-SNAPSHOT</version> <version>3.0.5-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<groupId>net.ihe.gazelle</groupId> <groupId>net.ihe.gazelle</groupId>
<artifactId>hl7templates-api-jar</artifactId> <artifactId>hl7templates-api-jar</artifactId>
<name>HL7Templates API JAR</name> <name>HL7Templates API JAR</name>
<version>3.0.4-SNAPSHOT</version> <version>3.0.5-SNAPSHOT</version>
<organization> <organization>
<name>IHE-Europe</name> <name>IHE-Europe</name>
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
<dependency> <dependency>
<groupId>net.ihe.gazelle</groupId> <groupId>net.ihe.gazelle</groupId>
<artifactId>hl7templates-model-jar</artifactId> <artifactId>hl7templates-model-jar</artifactId>
<version>3.0.4-SNAPSHOT</version> <version>3.0.5-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
......
...@@ -19,14 +19,14 @@ public abstract class ChoiceDefinitionProcessorImpl implements ChoiceDefinitionP ...@@ -19,14 +19,14 @@ public abstract class ChoiceDefinitionProcessorImpl implements ChoiceDefinitionP
this.processConstraints(ChoiceDefinitionUtil.getConstraints(t)); this.processConstraints(ChoiceDefinitionUtil.getConstraints(t));
this.processDescs(t.getDesc()); this.processDescs(t.getDesc());
//elements are processed according to the predicates type //elements are processed according to the predicates type
//this.processElements(ChoiceDefinitionUtil.getElements(t)); this.processElements(ChoiceDefinitionUtil.getElements(t));
this.processIncludes(ChoiceDefinitionUtil.getIncludes(t)); this.processIncludes(ChoiceDefinitionUtil.getIncludes(t));
this.processMaximumMultiplicity(t.getMaximumMultiplicity()); this.processMaximumMultiplicity(t.getMaximumMultiplicity());
this.processMinimumMultiplicity(t.getMinimumMultiplicity()); this.processMinimumMultiplicity(t.getMinimumMultiplicity());
this.processContains(ChoiceDefinitionUtil.getContains(t)); this.processContains(ChoiceDefinitionUtil.getContains(t));
this.processItem(t.getItem()); this.processItem(t.getItem());
//Comment next line to disable processing of the unsported HL7 choices //Comment next line to disable processing of the unsported HL7 choices specs
//this.processPredicates(ChoiceDefinitionUtil.getElements(t)); //this.processPredicates(ChoiceDefinitionUtil.getElements(t));
} }
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<parent> <parent>
<artifactId>gazelle-objects-checker</artifactId> <artifactId>gazelle-objects-checker</artifactId>
<groupId>net.ihe.gazelle</groupId> <groupId>net.ihe.gazelle</groupId>
<version>3.0.4-SNAPSHOT</version> <version>3.0.5-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<groupId>net.ihe.gazelle</groupId> <groupId>net.ihe.gazelle</groupId>
<artifactId>hl7templates-generator-jar</artifactId> <artifactId>hl7templates-generator-jar</artifactId>
<name>HL7Templates Generator JAR</name> <name>HL7Templates Generator JAR</name>
<version>3.0.4-SNAPSHOT</version> <version>3.0.5-SNAPSHOT</version>
<organization> <organization>
...@@ -143,7 +143,7 @@ ...@@ -143,7 +143,7 @@
<dependency> <dependency>
<groupId>net.ihe.gazelle</groupId> <groupId>net.ihe.gazelle</groupId>
<artifactId>gocmodel-jar</artifactId> <artifactId>gocmodel-jar</artifactId>
<version>3.0.4-SNAPSHOT</version> <version>3.0.5-SNAPSHOT</version>
</dependency> </dependency>
</dependencies> </dependencies>
</plugin> </plugin>
...@@ -238,7 +238,7 @@ ...@@ -238,7 +238,7 @@
<dependency> <dependency>
<groupId>net.ihe.gazelle</groupId> <groupId>net.ihe.gazelle</groupId>
<artifactId>hl7templates-model-jar</artifactId> <artifactId>hl7templates-model-jar</artifactId>
<version>3.0.4-SNAPSHOT</version> <version>3.0.5-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
...@@ -249,7 +249,7 @@ ...@@ -249,7 +249,7 @@
<dependency> <dependency>
<groupId>net.ihe.gazelle</groupId> <groupId>net.ihe.gazelle</groupId>
<artifactId>hl7templates-api-jar</artifactId> <artifactId>hl7templates-api-jar</artifactId>
<version>3.0.4-SNAPSHOT</version> <version>3.0.5-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.ihe.gazelle.svs</groupId> <groupId>net.ihe.gazelle.svs</groupId>
......
...@@ -4,6 +4,8 @@ package net.ihe.gazelle.tempgen.action; ...@@ -4,6 +4,8 @@ package net.ihe.gazelle.tempgen.action;
import net.ihe.gazelle.goc.uml.utils.XMIUtil; import net.ihe.gazelle.goc.uml.utils.XMIUtil;
import net.ihe.gazelle.goc.xmi.XMI; import net.ihe.gazelle.goc.xmi.XMI;
import net.ihe.gazelle.goc.xmi.XMIMarshaller; import net.ihe.gazelle.goc.xmi.XMIMarshaller;
import net.ihe.gazelle.goc.xmm.OwnedRule;
import net.ihe.gazelle.goc.xmm.PackagedElement;
import net.ihe.gazelle.tempgen.flatten.action.GeneralFlattenDecor; import net.ihe.gazelle.tempgen.flatten.action.GeneralFlattenDecor;
import net.ihe.gazelle.tempgen.flatten.action.RulesCleaner; import net.ihe.gazelle.tempgen.flatten.action.RulesCleaner;
import net.ihe.gazelle.tempgen.inc.action.IncludeFlattener; import net.ihe.gazelle.tempgen.inc.action.IncludeFlattener;
...@@ -19,6 +21,8 @@ import javax.xml.bind.JAXBException; ...@@ -19,6 +21,8 @@ import javax.xml.bind.JAXBException;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.InputStream; import java.io.InputStream;
import java.net.URL; import java.net.URL;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/** /**
* @author Abderrazek Boufahja * @author Abderrazek Boufahja
...@@ -138,6 +142,30 @@ public class HL7TemplatesConverter { ...@@ -138,6 +142,30 @@ public class HL7TemplatesConverter {
XMI xmi = XMIUtil.createXMI(prefix); XMI xmi = XMIUtil.createXMI(prefix);
//The entrypoint to convert the decor to OCL! //The entrypoint to convert the decor to OCL!
(new DecorAnalyzer()).process(decor, xmi, Boolean.valueOf(ignoreTemplateIdRequirements),ignoreChoicesPredicates); (new DecorAnalyzer()).process(decor, xmi, Boolean.valueOf(ignoreTemplateIdRequirements),ignoreChoicesPredicates);
//Skip incorrect OCL
clearXMI(xmi);
return xmi; return xmi;
} }
private void clearXMI(XMI xmi){
for(PackagedElement packagedElement:xmi.getModel().getPackagedElement()){
for(int ownedRule=0;ownedRule<packagedElement.getOwnedRule().size();ownedRule++) {
if(cleanOCL(packagedElement.getOwnedRule().get(ownedRule))==null) {
packagedElement.getOwnedRule().remove(packagedElement.getOwnedRule().get(ownedRule));
TamlHandler.removeTAML(packagedElement.getOwnedRule().get(ownedRule));
}
}
}
}
private OwnedRule cleanOCL(OwnedRule ownedRule){
String mat= ownedRule.getSpecification().getBody();
String matr= "\\)[A-Za-z]+";
Pattern pattern = Pattern.compile(matr);
Matcher matcher = pattern.matcher(ownedRule.getSpecification().getBody());
if(!matcher.find()){
return ownedRule;
}
return null;
}
} }
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<parent> <parent>
<artifactId>gazelle-objects-checker</artifactId> <artifactId>gazelle-objects-checker</artifactId>
<groupId>net.ihe.gazelle</groupId> <groupId>net.ihe.gazelle</groupId>
<version>3.0.4-SNAPSHOT</version> <version>3.0.5-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<groupId>net.ihe.gazelle</groupId> <groupId>net.ihe.gazelle</groupId>
<artifactId>hl7templates-model-jar</artifactId> <artifactId>hl7templates-model-jar</artifactId>
<name>HL7Templates Model JAR</name> <name>HL7Templates Model JAR</name>
<version>3.0.4-SNAPSHOT</version> <version>3.0.5-SNAPSHOT</version>
<organization> <organization>
<name>IHE-Europe</name> <name>IHE-Europe</name>
...@@ -134,7 +134,7 @@ ...@@ -134,7 +134,7 @@
<dependency> <dependency>
<groupId>net.ihe.gazelle</groupId> <groupId>net.ihe.gazelle</groupId>
<artifactId>gocmodel-jar</artifactId> <artifactId>gocmodel-jar</artifactId>
<version>3.0.4-SNAPSHOT</version> <version>3.0.5-SNAPSHOT</version>
</dependency> </dependency>
</dependencies> </dependencies>
</plugin> </plugin>
...@@ -214,7 +214,7 @@ ...@@ -214,7 +214,7 @@
<dependency> <dependency>
<groupId>net.ihe.gazelle</groupId> <groupId>net.ihe.gazelle</groupId>
<artifactId>gocmodel-jar</artifactId> <artifactId>gocmodel-jar</artifactId>
<version>3.0.4-SNAPSHOT</version> <version>3.0.5-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<parent> <parent>
<artifactId>gazelle-objects-checker</artifactId> <artifactId>gazelle-objects-checker</artifactId>
<groupId>net.ihe.gazelle</groupId> <groupId>net.ihe.gazelle</groupId>
<version>3.0.4-SNAPSHOT</version> <version>3.0.5-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<groupId>net.ihe.gazelle</groupId> <groupId>net.ihe.gazelle</groupId>
<artifactId>hl7templates-packager-jar</artifactId> <artifactId>hl7templates-packager-jar</artifactId>
<name>HL7 Templates Packager</name> <name>HL7 Templates Packager</name>
<version>3.0.4-SNAPSHOT</version> <version>3.0.5-SNAPSHOT</version>
<organization> <organization>
<name>IHE europe</name> <name>IHE europe</name>
...@@ -156,7 +156,7 @@ ...@@ -156,7 +156,7 @@
<dependency> <dependency>
<groupId>net.ihe.gazelle</groupId> <groupId>net.ihe.gazelle</groupId>
<artifactId>hl7templates-generator-jar</artifactId> <artifactId>hl7templates-generator-jar</artifactId>
<version>3.0.4-SNAPSHOT</version> <version>3.0.5-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
...@@ -186,7 +186,7 @@ ...@@ -186,7 +186,7 @@
<dependency> <dependency>
<groupId>net.ihe.gazelle.goc</groupId> <groupId>net.ihe.gazelle.goc</groupId>
<artifactId>validator-archetype-instantiator</artifactId> <artifactId>validator-archetype-instantiator</artifactId>
<version>3.0.4-SNAPSHOT</version> <version>3.0.5-SNAPSHOT</version>
<type>jar</type> <type>jar</type>
</dependency> </dependency>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<groupId>net.ihe.gazelle</groupId> <groupId>net.ihe.gazelle</groupId>
<artifactId>gazelle-objects-checker</artifactId> <artifactId>gazelle-objects-checker</artifactId>
<name>Gazelle Objects Checker</name> <name>Gazelle Objects Checker</name>
<version>3.0.4-SNAPSHOT</version> <version>3.0.5-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<organization> <organization>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment