Mentions légales du service

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

Merge branch 'develop' into 'master'

Develop

See merge request !44
parents f9862304 d3bc7aad
No related branches found
No related tags found
2 merge requests!45Master,!44Develop
Pipeline #749839 passed
This commit is part of merge request !45. Comments created here will be created in the context of that merge request.
Showing
with 67 additions and 76 deletions
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
include: include:
- project: 'gazelle/private/gitlab-ci-templates' - project: 'gazelle/private/gitlab-ci-templates'
file: 'extends-v2.yaml' file: 'extends-v2.yaml'
ref: 'master' ref: '1.0.0'
# Define stages # Define stages
stages: stages:
...@@ -13,66 +13,51 @@ stages: ...@@ -13,66 +13,51 @@ stages:
- publish - publish
- release - release
- upgrade - upgrade
- clean - cleanup
# Define global variables # Define global variables
variables: variables:
P_NAME: "gazelle-objects-checker"
P_APP_TYPE: "java"
P_CODE_SRC_PATH: "."
P_MAVEN_IMAGE_TAG: "3.6.3-jdk-11-slim" P_MAVEN_IMAGE_TAG: "3.6.3-jdk-11-slim"
# Define jobs
compile/unit-test: compile/unit-test:
stage: build stage: build
extends: extends:
- .buildJavaMavenTest - .buildJavaMavenTest
variables:
MAVEN_PHASE: "clean install"
P_MAVEN_EXTRA_ARGS: "-DskipITs"
package: package:
stage: build stage: build
extends: extends:
- .buildJavaMavenPackage - .buildJavaMavenPackage
needs:
- job: compile/unit-test
artifacts: true
variables: variables:
P_MAVEN_EXTRA_ARGS: "-DskipTests" P_MAVEN_EXTRA_ARGS: "-DskipTests -DskipITs"
integration-tests:
stage: test
extends:
- .testJavaMavenIntegrationTests
needs:
- job: compile/unit-test
artifacts: false
allow_failure: true
static-analysis:
stage: test
extends:
- .testJavaMavenSonarAnalysis
needs: needs:
- job: compile/unit-test - job: compile/unit-test
artifacts: true artifacts: true
variables:
P_MAVEN_EXTRA_ARGS: "-Psonar -DskipTests"
install-cache-repo: install-cache-repo:
stage: publish stage: publish
extends: extends:
- .publishJavaMavenInstall - .publishJavaMavenInstall
variables:
P_MAVEN_EXTRA_ARGS: "-DskipTests -DskipITs"
needs: needs:
- job: package - job: package
artifacts: false artifacts: true
variables:
P_MAVEN_EXTRA_ARGS: "-DskipTests"
publish-code:
stage: publish
extends:
- .publishJavaMavenDeploy
needs:
- job: package
artifacts: true
release/code: release/code:
stage: release stage: release
extends: extends:
- .releaseCodeForJava - .releaseCodeForJava
\ No newline at end of file when: manual
variables:
P_MAVEN_JAVADOC_SKIP: "true"
...@@ -10,7 +10,7 @@ public class ValidatorInstantiator { ...@@ -10,7 +10,7 @@ public class ValidatorInstantiator {
String loadMethod; String loadMethod;
String validatorRootClass; String validatorRootClass;
if ("cdaepsos".equals(configuration)) { if ("cdaepsos".equals(configuration)) {
validatorRootClass = "net.ihe.gazelle.cdaepsos3.POCDMT000040ClinicalDocument"; validatorRootClass = "net.ihe.gazelle.cdaepsos4.POCDMT000040ClinicalDocument";
loadMethod="load"; loadMethod="load";
} else { } else {
validatorRootClass = "net.ihe.gazelle.cda.POCDMT000040ClinicalDocument"; validatorRootClass = "net.ihe.gazelle.cda.POCDMT000040ClinicalDocument";
......
...@@ -201,13 +201,13 @@ ...@@ -201,13 +201,13 @@
<groupId>net.ihe.gazelle.cdaepsos</groupId> <groupId>net.ihe.gazelle.cdaepsos</groupId>
<artifactId>cdaepsos-code-jar</artifactId> <artifactId>cdaepsos-code-jar</artifactId>
<type>jar</type> <type>jar</type>
<version>1.9</version> <version>1.2.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.ihe.gazelle.cdaepsos</groupId> <groupId>net.ihe.gazelle.cdaepsos</groupId>
<artifactId>cdaepsos-validator-jar</artifactId> <artifactId>cdaepsos-validator-jar</artifactId>
<version>1.0</version> <version>1.1.0</version>
</dependency> </dependency>
<dependency> <dependency>
......
...@@ -16,7 +16,7 @@ import javax.xml.xpath.XPathConstants; ...@@ -16,7 +16,7 @@ import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpression; import javax.xml.xpath.XPathExpression;
import javax.xml.xpath.XPathFactory; import javax.xml.xpath.XPathFactory;
import net.ihe.gazelle.cdaepsos3.cdaepsos3.CDAEPSOS3PackValidator; import net.ihe.gazelle.cdaepsos4.cdaepsos4.CDAEPSOS4PackValidator;
import net.ihe.gazelle.cda.cdabasic.CDABASICPackValidator; import net.ihe.gazelle.cda.cdabasic.CDABASICPackValidator;
import net.ihe.gazelle.cda.cdadt.CDADTPackValidator; import net.ihe.gazelle.cda.cdadt.CDADTPackValidator;
import net.ihe.gazelle.cda.cdanblock.CDANBLOCKPackValidator; import net.ihe.gazelle.cda.cdanblock.CDANBLOCKPackValidator;
...@@ -197,7 +197,7 @@ class MicroDocumentValidation { ...@@ -197,7 +197,7 @@ class MicroDocumentValidation {
ltp.add(new ${projectNameCapitalyzedFirst}Parser()); ltp.add(new ${projectNameCapitalyzedFirst}Parser());
// --conditional validation // --conditional validation
listConstraintValidatorModule.add(new CDAEPSOS3PackValidator()); listConstraintValidatorModule.add(new CDAEPSOS4PackValidator());
MicroDocumentValidation.validateWithExtendedCDAValidator(documentContent, listConstraintValidatorModule, ltp, dr); MicroDocumentValidation.validateWithExtendedCDAValidator(documentContent, listConstraintValidatorModule, ltp, dr);
${validatorRootClass} clin = null; ${validatorRootClass} clin = null;
......
imports=net.ihe.gazelle.medication2.*,net.ihe.gazelle.cdaepsos3.*,net.ihe.gazelle.datatypes.*,net.ihe.gazelle.nblock.*,net.ihe.gazelle.voc.* imports=net.ihe.gazelle.medication2.*,net.ihe.gazelle.pharm.*,net.ihe.gazelle.cdaepsos4.*,net.ihe.gazelle.datatypes.*,net.ihe.gazelle.nblock.*,net.ihe.gazelle.voc.*
...@@ -322,12 +322,12 @@ ...@@ -322,12 +322,12 @@
<dependency> <dependency>
<groupId>net.ihe.gazelle.model</groupId> <groupId>net.ihe.gazelle.model</groupId>
<artifactId>cda-model</artifactId> <artifactId>cda-model</artifactId>
<version>3.1.0</version> <version>3.1.1</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.ihe.gazelle.model</groupId> <groupId>net.ihe.gazelle.model</groupId>
<artifactId>cdaepsos-model</artifactId> <artifactId>cdaepsos-model</artifactId>
<version>3.1.0</version> <version>3.1.1</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>commons-io</groupId> <groupId>commons-io</groupId>
......
...@@ -232,7 +232,7 @@ public class AttributeAnalyzer extends AttributeProcessorImpl { ...@@ -232,7 +232,7 @@ public class AttributeAnalyzer extends AttributeProcessorImpl {
@Override @Override
public void processIsOptional(Boolean isOptional) { public void processIsOptional(Boolean isOptional) {
if (isOptional == null || !isOptional.booleanValue()){ if ((isOptional == null || !isOptional.booleanValue()) ){
List<String> listAttrNames = AttributeUtil.getListAttributesNames(selectedAttribute); List<String> listAttrNames = AttributeUtil.getListAttributesNames(selectedAttribute);
for (String attrName : listAttrNames) { for (String attrName : listAttrNames) {
if (AttributeUtil.assertAttributeIsNotRequiredByDefault(this.selectedAttribute, attrName)){ if (AttributeUtil.assertAttributeIsNotRequiredByDefault(this.selectedAttribute, attrName)){
......
...@@ -152,7 +152,7 @@ public class HL7TemplatesConverter { ...@@ -152,7 +152,7 @@ public class HL7TemplatesConverter {
for(Iterator<OwnedRule> itor = currentPe.getOwnedRule().listIterator(); itor.hasNext();){ for(Iterator<OwnedRule> itor = currentPe.getOwnedRule().listIterator(); itor.hasNext();){
OwnedRule currentOr = itor.next(); OwnedRule currentOr = itor.next();
if(!isOclClean(currentOr)){ if(!isOclClean(currentOr)){
log.info("Removing wrong OCL: {}",currentOr.getId()); log.info("Removing wrong OCL: {}",currentOr.getSpecification().getBody());
//TamlHandler.removeTAML(currentOr); //TamlHandler.removeTAML(currentOr);
removedOrIds.add(currentOr.getId()); removedOrIds.add(currentOr.getId());
itor.remove(); itor.remove();
......
...@@ -229,5 +229,6 @@ ...@@ -229,5 +229,6 @@
<version>1.4.1</version> <version>1.4.1</version>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>
package net.ihe.gazelle.tempmodel.org.decor.art.utils; package net.ihe.gazelle.tempmodel.org.decor.art.utils;
import java.io.FileInputStream; import net.ihe.gazelle.tempmodel.org.decor.art.model.Decor;
import java.io.IOException; import org.apache.commons.validator.routines.UrlValidator;
import java.io.InputStream; import org.slf4j.Logger;
import java.io.OutputStream; import org.slf4j.LoggerFactory;
import java.net.URL;
import java.net.URLConnection;
import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException; import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller; import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller; import javax.xml.bind.Unmarshaller;
import java.io.FileInputStream;
import org.apache.commons.validator.routines.UrlValidator; import java.io.IOException;
import org.slf4j.Logger; import java.io.InputStream;
import org.slf4j.LoggerFactory; import java.io.OutputStream;
import java.net.URL;
import net.ihe.gazelle.tempmodel.org.decor.art.model.Decor; import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
/** /**
* *
...@@ -27,6 +27,11 @@ public final class DecorMarshaller { ...@@ -27,6 +27,11 @@ public final class DecorMarshaller {
private static Logger log = LoggerFactory.getLogger(DecorMarshaller.class); private static Logger log = LoggerFactory.getLogger(DecorMarshaller.class);
private static HttpClient httpClient = HttpClient.newBuilder()
.connectTimeout(java.time.Duration.ofSeconds(10))
.followRedirects(HttpClient.Redirect.ALWAYS)
.build();
private DecorMarshaller() {} private DecorMarshaller() {}
...@@ -65,19 +70,13 @@ public final class DecorMarshaller { ...@@ -65,19 +70,13 @@ public final class DecorMarshaller {
InputStream is = null; InputStream is = null;
try { try {
if (UrlValidator.getInstance().isValid(path)) { if (UrlValidator.getInstance().isValid(path)) {
URL url; is = getInputStreamFromURL(path);
url = new URL(path);
URLConnection urlConnection = url.openConnection();
urlConnection.setConnectTimeout(10000);
urlConnection.setReadTimeout(10000);
is = urlConnection.getInputStream();
} }
else { else {
is = new FileInputStream(path); is = new FileInputStream(path);
} }
return loadDecor(is); return loadDecor(is);
} catch (IOException e) { } catch (IOException | InterruptedException e) {
log.error("Error to load decor from url : " + path, e); log.error("Error to load decor from url : " + path, e);
}finally { }finally {
if (is != null) { if (is != null) {
...@@ -106,5 +105,14 @@ public final class DecorMarshaller { ...@@ -106,5 +105,14 @@ public final class DecorMarshaller {
mar.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); mar.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
mar.marshal(decor, os); mar.marshal(decor, os);
} }
private static InputStream getInputStreamFromURL(String url) throws IOException, InterruptedException {
HttpRequest request = HttpRequest.newBuilder()
.GET()
.uri(java.net.URI.create(url))
.build();
HttpResponse<InputStream> response = httpClient.send(request, HttpResponse.BodyHandlers.ofInputStream());
return response.body();
}
} }
...@@ -198,16 +198,7 @@ ...@@ -198,16 +198,7 @@
<type>jar</type> <type>jar</type>
</dependency> </dependency>
<dependency>
<groupId>net.ihe.gazelle.model</groupId>
<artifactId>cda-model</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>net.ihe.gazelle.model</groupId>
<artifactId>cdaepsos-model</artifactId>
<version>3.1.0</version>
</dependency>
<dependency> <dependency>
<groupId>org.apache.logging.log4j</groupId> <groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId> <artifactId>log4j-core</artifactId>
......
...@@ -204,9 +204,10 @@ public class ArchetypeInstantiatorMaven implements ArchetypeInstantiator { ...@@ -204,9 +204,10 @@ public class ArchetypeInstantiatorMaven implements ArchetypeInstantiator {
version = System.getProperty("GOC_VERSION"); version = System.getProperty("GOC_VERSION");
if(version == null){ if(version == null){
log.error("Could not find GOC version, trying to get it from latest release in nexus"); log.error("Could not find GOC version, trying to get it from latest release in nexus");
version = getLatestGOCVersion();
} }
version = getLatestGOCVersion();
} }
log.info("GOC version is {}",version);
return version; return version;
} }
......
...@@ -7,5 +7,10 @@ ...@@ -7,5 +7,10 @@
<username>${ARTIFACT_RELEASE_REPOSITORY_USER}</username> <username>${ARTIFACT_RELEASE_REPOSITORY_USER}</username>
<password>${ARTIFACT_RELEASE_REPOSITORY_PASS}</password> <password>${ARTIFACT_RELEASE_REPOSITORY_PASS}</password>
</server> </server>
<server>
<id>nexus-snapshots</id>
<username>${ARTIFACT_RELEASE_REPOSITORY_USER}</username>
<password>${ARTIFACT_RELEASE_REPOSITORY_PASS}</password>
</server>
</servers> </servers>
</settings> </settings>
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