Mentions légales du service

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

Merge branch 'develop' into bugfix/sequoia-regen-april-22

# Conflicts:
#	hl7templates/hl7templates-api-jar/src/main/java/net/ihe/gazelle/tempapi/impl/ChoiceDefinitionProcessorImpl.java
parents e391a2ef 6aed69d6
No related branches found
No related tags found
2 merge requests!30Develop,!28Feature/choices implementation
Showing
with 65 additions and 36 deletions
......@@ -4,7 +4,7 @@
<parent>
<artifactId>gazelle-objects-checker</artifactId>
<groupId>net.ihe.gazelle</groupId>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.5-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
......@@ -13,7 +13,7 @@
<groupId>net.ihe.gazelle.goc</groupId>
<artifactId>generated-validator</artifactId>
<packaging>pom</packaging>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.5-SNAPSHOT</version>
<modules>
<module>validator-archetype-instantiator</module>
<module>validator-archetype</module>
......@@ -47,7 +47,7 @@
<dependency>
<groupId>net.ihe.gazelle.goctests</groupId>
<artifactId>goc-annotations</artifactId>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.5-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
......@@ -3,12 +3,12 @@
<parent>
<artifactId>generated-validator</artifactId>
<groupId>net.ihe.gazelle.goc</groupId>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.5-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>validator-archetype-instantiator</artifactId>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.5-SNAPSHOT</version>
<packaging>jar</packaging>
</project>
\ No newline at end of file
......@@ -3,11 +3,11 @@
<parent>
<artifactId>generated-validator</artifactId>
<groupId>net.ihe.gazelle.goc</groupId>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.5-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>validator-archetype</artifactId>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.5-SNAPSHOT</version>
<packaging>maven-archetype</packaging>
<build>
......
......@@ -3,7 +3,7 @@
<parent>
<artifactId>goc-tests</artifactId>
<groupId>net.ihe.gazelle</groupId>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.5-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
......@@ -11,7 +11,7 @@
<groupId>net.ihe.gazelle.goctests</groupId>
<artifactId>goc-annotations</artifactId>
<name>GOC Annotations</name>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.5-SNAPSHOT</version>
<build>
......
......@@ -3,7 +3,7 @@
<parent>
<artifactId>goc-tests</artifactId>
<groupId>net.ihe.gazelle</groupId>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.5-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
......@@ -11,7 +11,7 @@
<groupId>net.ihe.gazelle.goctests</groupId>
<artifactId>goc-tests-runner</artifactId>
<name>GOC Tests Runner</name>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.5-SNAPSHOT</version>
<build>
......@@ -110,7 +110,7 @@
<dependency>
<groupId>net.ihe.gazelle</groupId>
<artifactId>hl7templates-packager-jar</artifactId>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.5-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
......@@ -7,6 +7,7 @@ import org.junit.Ignore;
import org.junit.Test;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
......@@ -27,7 +28,7 @@ public class ValidatorGeneratorTest {
String output = "[YOUR CDA PATH]";
String mvn = "[YOUR MVN PATH]";
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);
System.out.println(validator);
} catch (ValidatorGenerationException | MalformedURLException e) {
......
......@@ -3,7 +3,7 @@
<parent>
<artifactId>gazelle-objects-checker</artifactId>
<groupId>net.ihe.gazelle</groupId>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.5-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
......@@ -11,7 +11,7 @@
<groupId>net.ihe.gazelle</groupId>
<artifactId>goc-tests</artifactId>
<name>GOC Tests</name>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.5-SNAPSHOT</version>
<packaging>pom</packaging>
......
......@@ -3,7 +3,7 @@
<parent>
<artifactId>gazelle-objects-checker</artifactId>
<groupId>net.ihe.gazelle</groupId>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.5-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
......@@ -11,7 +11,7 @@
<groupId>net.ihe.gazelle</groupId>
<artifactId>gocmodel-jar</artifactId>
<name>GOC Model JAR</name>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.5-SNAPSHOT</version>
<organization>
<name>IHE-Europe</name>
......@@ -337,7 +337,7 @@
<dependency>
<groupId>net.ihe.gazelle.goctests</groupId>
<artifactId>goc-annotations</artifactId>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.5-SNAPSHOT</version>
</dependency>
</dependencies>
......
......@@ -3,7 +3,7 @@
<parent>
<artifactId>gazelle-objects-checker</artifactId>
<groupId>net.ihe.gazelle</groupId>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.5-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
......@@ -11,7 +11,7 @@
<groupId>net.ihe.gazelle</groupId>
<artifactId>hl7templates-api-jar</artifactId>
<name>HL7Templates API JAR</name>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.5-SNAPSHOT</version>
<organization>
<name>IHE-Europe</name>
......@@ -81,7 +81,7 @@
<dependency>
<groupId>net.ihe.gazelle</groupId>
<artifactId>hl7templates-model-jar</artifactId>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.5-SNAPSHOT</version>
</dependency>
<dependency>
......
......@@ -27,7 +27,7 @@ public abstract class ChoiceDefinitionProcessorImpl implements ChoiceDefinitionP
this.processItem(t.getItem());
//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 @@
<parent>
<artifactId>gazelle-objects-checker</artifactId>
<groupId>net.ihe.gazelle</groupId>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.5-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
......@@ -11,7 +11,7 @@
<groupId>net.ihe.gazelle</groupId>
<artifactId>hl7templates-generator-jar</artifactId>
<name>HL7Templates Generator JAR</name>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.5-SNAPSHOT</version>
<organization>
......@@ -143,7 +143,7 @@
<dependency>
<groupId>net.ihe.gazelle</groupId>
<artifactId>gocmodel-jar</artifactId>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.5-SNAPSHOT</version>
</dependency>
</dependencies>
</plugin>
......@@ -238,7 +238,7 @@
<dependency>
<groupId>net.ihe.gazelle</groupId>
<artifactId>hl7templates-model-jar</artifactId>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.5-SNAPSHOT</version>
</dependency>
<dependency>
......@@ -249,7 +249,7 @@
<dependency>
<groupId>net.ihe.gazelle</groupId>
<artifactId>hl7templates-api-jar</artifactId>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>net.ihe.gazelle.svs</groupId>
......
......@@ -4,6 +4,8 @@ package net.ihe.gazelle.tempgen.action;
import net.ihe.gazelle.goc.uml.utils.XMIUtil;
import net.ihe.gazelle.goc.xmi.XMI;
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.RulesCleaner;
import net.ihe.gazelle.tempgen.inc.action.IncludeFlattener;
......@@ -19,6 +21,8 @@ import javax.xml.bind.JAXBException;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.net.URL;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* @author Abderrazek Boufahja
......@@ -138,6 +142,30 @@ public class HL7TemplatesConverter {
XMI xmi = XMIUtil.createXMI(prefix);
//The entrypoint to convert the decor to OCL!
(new DecorAnalyzer()).process(decor, xmi, Boolean.valueOf(ignoreTemplateIdRequirements),ignoreChoicesPredicates);
//Skip incorrect OCL
clearXMI(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 @@
<parent>
<artifactId>gazelle-objects-checker</artifactId>
<groupId>net.ihe.gazelle</groupId>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.5-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
......@@ -11,7 +11,7 @@
<groupId>net.ihe.gazelle</groupId>
<artifactId>hl7templates-model-jar</artifactId>
<name>HL7Templates Model JAR</name>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.5-SNAPSHOT</version>
<organization>
<name>IHE-Europe</name>
......@@ -134,7 +134,7 @@
<dependency>
<groupId>net.ihe.gazelle</groupId>
<artifactId>gocmodel-jar</artifactId>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.5-SNAPSHOT</version>
</dependency>
</dependencies>
</plugin>
......@@ -214,7 +214,7 @@
<dependency>
<groupId>net.ihe.gazelle</groupId>
<artifactId>gocmodel-jar</artifactId>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.5-SNAPSHOT</version>
</dependency>
<dependency>
......
......@@ -3,7 +3,7 @@
<parent>
<artifactId>gazelle-objects-checker</artifactId>
<groupId>net.ihe.gazelle</groupId>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.5-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
......@@ -11,7 +11,7 @@
<groupId>net.ihe.gazelle</groupId>
<artifactId>hl7templates-packager-jar</artifactId>
<name>HL7 Templates Packager</name>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.5-SNAPSHOT</version>
<organization>
<name>IHE europe</name>
......@@ -156,7 +156,7 @@
<dependency>
<groupId>net.ihe.gazelle</groupId>
<artifactId>hl7templates-generator-jar</artifactId>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.5-SNAPSHOT</version>
</dependency>
<dependency>
......@@ -186,7 +186,7 @@
<dependency>
<groupId>net.ihe.gazelle.goc</groupId>
<artifactId>validator-archetype-instantiator</artifactId>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.5-SNAPSHOT</version>
<type>jar</type>
</dependency>
......
......@@ -4,7 +4,7 @@
<groupId>net.ihe.gazelle</groupId>
<artifactId>gazelle-objects-checker</artifactId>
<name>Gazelle Objects Checker</name>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.5-SNAPSHOT</version>
<packaging>pom</packaging>
<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