Skip to content

Commit

Permalink
Merge pull request #242 from ansforge/auto/model_tracker
Browse files Browse the repository at this point in the history
[ AUTO ] Model Tracker
  • Loading branch information
bou3108 authored Feb 9, 2025
2 parents dd85d72 + c534c30 commit 37933fc
Show file tree
Hide file tree
Showing 195 changed files with 233 additions and 70 deletions.
Binary file modified csv_parser/models/model.xlsx
Binary file not shown.
Binary file modified csv_parser/out/EMSI/EMSI.schema.docx
Binary file not shown.
Binary file modified csv_parser/out/EMSI/EMSI.uml_diagram.pdf
Binary file not shown.
Binary file modified csv_parser/out/GEO-POS/GEO-POS.schema.docx
Binary file not shown.
Binary file modified csv_parser/out/GEO-POS/GEO-POS.uml_diagram.pdf
Binary file not shown.
Binary file modified csv_parser/out/GEO-REQ/GEO-REQ.schema.docx
Binary file not shown.
Binary file modified csv_parser/out/GEO-REQ/GEO-REQ.uml_diagram.pdf
Binary file not shown.
Binary file modified csv_parser/out/GEO-RES/GEO-RES.schema.docx
Binary file not shown.
Binary file modified csv_parser/out/GEO-RES/GEO-RES.uml_diagram.pdf
Binary file not shown.
Binary file modified csv_parser/out/RC-DE/RC-DE.schema.docx
Binary file not shown.
Binary file modified csv_parser/out/RC-DE/RC-DE.uml_diagram.pdf
Binary file not shown.
Binary file modified csv_parser/out/RC-EDA/RC-EDA.schema.docx
Binary file not shown.
Binary file modified csv_parser/out/RC-EDA/RC-EDA.uml_diagram.pdf
Binary file not shown.
Binary file modified csv_parser/out/RC-REF/RC-REF.schema.docx
Binary file not shown.
Binary file modified csv_parser/out/RC-REF/RC-REF.uml_diagram.pdf
Binary file not shown.
Binary file modified csv_parser/out/RS-BPV/RS-BPV.schema.docx
Binary file not shown.
Binary file modified csv_parser/out/RS-BPV/RS-BPV.uml_diagram.pdf
Binary file not shown.
Binary file modified csv_parser/out/RS-DR/RS-DR.schema.docx
Binary file not shown.
Binary file modified csv_parser/out/RS-DR/RS-DR.uml_diagram.pdf
Binary file not shown.
Binary file modified csv_parser/out/RS-EDA-MAJ/RS-EDA-MAJ.schema.docx
Binary file not shown.
Binary file modified csv_parser/out/RS-EDA-MAJ/RS-EDA-MAJ.uml_diagram.pdf
Binary file not shown.
Binary file modified csv_parser/out/RS-EDA/RS-EDA.schema.docx
Binary file not shown.
Binary file modified csv_parser/out/RS-EDA/RS-EDA.uml_diagram.pdf
Binary file not shown.
Binary file modified csv_parser/out/RS-ER/RS-ER.schema.docx
Binary file not shown.
Binary file modified csv_parser/out/RS-ER/RS-ER.uml_diagram.pdf
Binary file not shown.
Binary file modified csv_parser/out/RS-ERROR/RS-ERROR.schema.docx
Binary file not shown.
Binary file modified csv_parser/out/RS-ERROR/RS-ERROR.uml_diagram.pdf
Binary file not shown.
Binary file modified csv_parser/out/RS-RI/RS-RI.schema.docx
Binary file not shown.
Binary file modified csv_parser/out/RS-RI/RS-RI.uml_diagram.pdf
Binary file not shown.
Binary file modified csv_parser/out/RS-RPIS/RS-RPIS.schema.docx
Binary file not shown.
Binary file modified csv_parser/out/RS-RPIS/RS-RPIS.uml_diagram.pdf
Binary file not shown.
Binary file modified csv_parser/out/RS-RR/RS-RR.schema.docx
Binary file not shown.
Binary file modified csv_parser/out/RS-RR/RS-RR.uml_diagram.pdf
Binary file not shown.
Binary file modified csv_parser/out/RS-SR/RS-SR.schema.docx
Binary file not shown.
Binary file modified csv_parser/out/RS-SR/RS-SR.uml_diagram.pdf
Binary file not shown.
Binary file modified csv_parser/out/RS-URL/RS-URL.schema.docx
Binary file not shown.
Binary file modified csv_parser/out/RS-URL/RS-URL.uml_diagram.pdf
Binary file not shown.
Binary file modified csv_parser/out/TECHNICAL/TECHNICAL.schema.docx
Binary file not shown.
Binary file modified csv_parser/out/TECHNICAL/TECHNICAL.uml_diagram.pdf
Binary file not shown.
Binary file modified csv_parser/out/TECHNICAL_NOREQ/TECHNICAL_NOREQ.schema.docx
Binary file not shown.
Binary file modified csv_parser/out/TECHNICAL_NOREQ/TECHNICAL_NOREQ.uml_diagram.pdf
Binary file not shown.
Binary file modified csv_parser/out/customContent/customContent.schema.docx
Binary file not shown.
Binary file modified csv_parser/out/customContent/customContent.uml_diagram.pdf
Binary file not shown.
Binary file modified nomenclature_parser/in/Nomenclatures RC-EDA et messages RS.xlsx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/Sommaire Nomenclature Hub.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/EMSI-CONTEXT.LEVEL.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/EMSI-CONTEXT.LINK_ROLE.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/EMSI-CONTEXT.MODE.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/EMSI-CONTEXT.MSGTYPE.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/EMSI-CONTEXT.SECLASS.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/EMSI-EVENT.CAUSE.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/EMSI-EVENT.EGEO.TYPE.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/EMSI-EVENT.EGEO.WEATHER.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/EMSI-EVENT.ETYPE.ACTOR.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/EMSI-EVENT.ETYPE.CATEGORY.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/EMSI-EVENT.ETYPE.ENV.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/EMSI-EVENT.ETYPE.LOCTYPE.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/EMSI-EVENT.POSITION.TYPE.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/EMSI-EVENT.RISK_ASSESSMNT.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/EMSI-EVENT.SCALE.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/EMSI-EVENT.SOURCE.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/EMSI-EVENT.STATUS.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/EMSI-MISSION.TYPE.pdf
Binary file not shown.
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/EMSI-RESOURCE.RTYPE.CLASS.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/EMSI-RESOURCE.UM.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/EMSI-RGEO.POSITION.TYPE.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/HubSante.attribution.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/HubSante.cadre.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/HubSante.canal.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/HubSante.communication.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/HubSante.delai.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/HubSante.effet.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/HubSante.etape.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/HubSante.etat.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/HubSante.etatDemande.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/HubSante.fait.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/HubSante.filiere.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/HubSante.idLieu.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/HubSante.intervention.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/HubSante.langue.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/HubSante.lieu.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/HubSante.motif.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/HubSante.nbVictimes.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/HubSante.niveauSoin.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/HubSante.objetSource.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/HubSante.origine.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/HubSante.patient.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/HubSante.precision.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/HubSante.priorite.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/HubSante.reponseDemande.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/HubSante.risque.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/HubSante.role.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/HubSante.sexe.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/HubSante.signalement.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/HubSante.statutVecteur.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/HubSante.systeme.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/HubSante.typeAppelant.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/HubSante.typeCom.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/HubSante.typeDecision.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/HubSante.typeIdPatient.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/HubSante.typeOrientation.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/HubSante.typePEC.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/HubSante.typeRessource.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/HubSante.typeVecteur.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/pdf/ISO 3166-ISO3166-2.pdf
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/EMSI-CONTEXT.LEVEL.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/EMSI-CONTEXT.LINK_ROLE.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/EMSI-CONTEXT.MODE.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/EMSI-CONTEXT.MSGTYPE.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/EMSI-CONTEXT.SECLASS.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/EMSI-EVENT.CAUSE.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/EMSI-EVENT.EGEO.TYPE.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/EMSI-EVENT.EGEO.WEATHER.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/EMSI-EVENT.ETYPE.ACTOR.docx
Binary file not shown.
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/EMSI-EVENT.ETYPE.ENV.docx
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/EMSI-EVENT.SCALE.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/EMSI-EVENT.SOURCE.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/EMSI-EVENT.STATUS.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/EMSI-MISSION.TYPE.docx
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/EMSI-RESOURCE.UM.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/EMSI-RGEO.POSITION.TYPE.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/HubSante.attribution.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/HubSante.cadre.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/HubSante.canal.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/HubSante.communication.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/HubSante.delai.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/HubSante.effet.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/HubSante.etape.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/HubSante.etat.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/HubSante.etatDemande.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/HubSante.fait.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/HubSante.filiere.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/HubSante.idLieu.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/HubSante.intervention.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/HubSante.langue.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/HubSante.lieu.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/HubSante.motif.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/HubSante.nbVictimes.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/HubSante.niveauSoin.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/HubSante.objetSource.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/HubSante.origine.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/HubSante.patient.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/HubSante.precision.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/HubSante.priorite.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/HubSante.reponseDemande.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/HubSante.risque.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/HubSante.role.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/HubSante.sexe.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/HubSante.signalement.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/HubSante.statutVecteur.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/HubSante.systeme.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/HubSante.typeAppelant.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/HubSante.typeCom.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/HubSante.typeDecision.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/HubSante.typeIdPatient.docx
Binary file not shown.
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/HubSante.typePEC.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/HubSante.typeRessource.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/HubSante.typeVecteur.docx
Binary file not shown.
Binary file modified nomenclature_parser/out/latest/word/ISO 3166-ISO3166-2.docx
Binary file not shown.
32 changes: 10 additions & 22 deletions src/main/java/com/hubsante/model/EdxlHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,39 +15,27 @@
*/
package com.hubsante.model;

import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.databind.*;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import com.hubsante.model.edxl.EdxlEnvelope;
import com.hubsante.model.edxl.EdxlMessage;
import lombok.extern.slf4j.Slf4j;

import java.io.IOException;
import java.time.OffsetDateTime;
import java.time.format.DateTimeFormatter;

@Slf4j
public class EdxlHandler {

public XmlMapper xmlMapper;

public ObjectMapper jsonMapper;

public EdxlHandler() {
xmlMapper = (XmlMapper) new XmlMapper()
.registerModule(new JavaTimeModule())
.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
.disable(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE);
public XmlMapper xmlMapper = Utils.getXmlMapper();

xmlMapper.configure(com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator.Feature.WRITE_XML_DECLARATION, true);

jsonMapper = new ObjectMapper()
.registerModule(new JavaTimeModule())
.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
.disable(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE);
}
public ObjectMapper jsonMapper = Utils.getJsonMapper();

public EdxlMessage deserializeJsonEDXL(String json) throws JsonProcessingException {
return jsonMapper.readValue(json, EdxlMessage.class);
Expand Down
75 changes: 75 additions & 0 deletions src/main/java/com/hubsante/model/Utils.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/**
* Copyright © 2023-2025 Agence du Numerique en Sante (ANS)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hubsante.model;

import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;

import java.io.IOException;
import java.time.OffsetDateTime;
import java.time.format.DateTimeFormatter;

public class Utils {

public static JavaTimeModule createCustomJavaTimeModule() {
JavaTimeModule javaTimeModule = new JavaTimeModule();

javaTimeModule.addSerializer(OffsetDateTime.class,
new com.fasterxml.jackson.databind.ser.std.StdSerializer<OffsetDateTime>(OffsetDateTime.class) {

@Override
public void serialize(OffsetDateTime value, com.fasterxml.jackson.core.JsonGenerator gen,
com.fasterxml.jackson.databind.SerializerProvider provider) throws IOException {
String formatted = value.format(DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssXXX"));
// Replace 'Z' with '+00:00' during serialization
if (formatted.endsWith("Z")) {
formatted = formatted.substring(0, formatted.length() - 1) + "+00:00";
}

gen.writeString(formatted);
}
}
);

return javaTimeModule;
}

public static XmlMapper getXmlMapper() {
XmlMapper xmlMapper = new XmlMapper();
xmlMapper = (XmlMapper) new XmlMapper()
.registerModule(createCustomJavaTimeModule())
.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
.disable(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE);

xmlMapper.configure(com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator.Feature.WRITE_XML_DECLARATION, true);
return xmlMapper;
}

public static ObjectMapper getJsonMapper() {
ObjectMapper jsonMapper = new ObjectMapper()
.registerModule(createCustomJavaTimeModule())
.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
.disable(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE);

return jsonMapper;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/**
* Copyright © 2023-2025 Agence du Numerique en Sante (ANS)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hubsante.model.builders;

import com.hubsante.model.health.CreateCaseHealth;
import com.hubsante.model.health.CreateCaseHealthWrapper;
import com.hubsante.model.rcde.DistributionElement;

public class CreateCaseHealthWrapperBuilder {

private DistributionElement distributionElement;
private CreateCaseHealth createCaseHealth;

public CreateCaseHealthWrapperBuilder(DistributionElement distributionElement, CreateCaseHealth createCaseHealth) {
this.distributionElement = distributionElement;
this.createCaseHealth = createCaseHealth;
}

public CreateCaseHealthWrapper build() {
CreateCaseHealthWrapper createCaseHealthMessage = new CreateCaseHealthWrapper();
createCaseHealthMessage.setMessageId(distributionElement.getMessageId());
createCaseHealthMessage.setSender(distributionElement.getSender());
createCaseHealthMessage.setSentAt(distributionElement.getSentAt());
if (!distributionElement.getKind().equals(DistributionElement.KindEnum.REPORT)) {
throw new IllegalArgumentException("CreateCaseWrapper must be of kind REPORT");
}
createCaseHealthMessage.setKind(distributionElement.getKind());
createCaseHealthMessage.setStatus(distributionElement.getStatus());
createCaseHealthMessage.setRecipient(distributionElement.getRecipient());
createCaseHealthMessage.setCreateCaseHealth(createCaseHealth);
return createCaseHealthMessage;
}
}
2 changes: 1 addition & 1 deletion src/main/resources/json-schema/EMSI.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "classpath:/json-schema/schema#",
"x-id": "EMSI.schema.json#",
"version": "25.01.30",
"version": "25.02.09",
"example": "example.json#",
"type": "object",
"title": "emsi",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/json-schema/GEO-POS.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "classpath:/json-schema/schema#",
"x-id": "GEO-POS.schema.json#",
"version": "25.01.30",
"version": "25.02.09",
"example": "example.json#",
"type": "object",
"title": "geoPositionsUpdate",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/json-schema/GEO-REQ.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "classpath:/json-schema/schema#",
"x-id": "GEO-REQ.schema.json#",
"version": "25.01.30",
"version": "25.02.09",
"example": "example.json#",
"type": "object",
"title": "geoResourcesRequest",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/json-schema/GEO-RES.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "classpath:/json-schema/schema#",
"x-id": "GEO-RES.schema.json#",
"version": "25.01.30",
"version": "25.02.09",
"example": "example.json#",
"type": "object",
"title": "geoResourcesDetails",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/json-schema/RC-DE.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "classpath:/json-schema/schema#",
"x-id": "RC-DE.schema.json#",
"version": "25.01.30",
"version": "25.02.09",
"example": "example.json#",
"type": "object",
"title": "distributionElement",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/json-schema/RC-EDA.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "classpath:/json-schema/schema#",
"x-id": "RC-EDA.schema.json#",
"version": "25.01.30",
"version": "25.02.09",
"example": "example.json#",
"type": "object",
"title": "createCase",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/json-schema/RC-REF.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "classpath:/json-schema/schema#",
"x-id": "RC-REF.schema.json#",
"version": "25.01.30",
"version": "25.02.09",
"example": "example.json#",
"type": "object",
"title": "reference",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/json-schema/RS-BPV.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "classpath:/json-schema/schema#",
"x-id": "RS-BPV.schema.json#",
"version": "25.01.30",
"version": "25.02.09",
"example": "example.json#",
"type": "object",
"title": "interventionReport",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/json-schema/RS-DR.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "classpath:/json-schema/schema#",
"x-id": "RS-DR.schema.json#",
"version": "25.01.30",
"version": "25.02.09",
"example": "example.json#",
"type": "object",
"title": "resourcesRequest",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/json-schema/RS-EDA-MAJ.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "classpath:/json-schema/schema#",
"x-id": "RS-EDA-MAJ.schema.json#",
"version": "25.01.30",
"version": "25.02.09",
"example": "example.json#",
"type": "object",
"title": "createCaseHealthUpdate",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/json-schema/RS-EDA.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "classpath:/json-schema/schema#",
"x-id": "RS-EDA.schema.json#",
"version": "25.01.30",
"version": "25.02.09",
"example": "example.json#",
"type": "object",
"title": "createCaseHealth",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/json-schema/RS-ER.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "classpath:/json-schema/schema#",
"x-id": "RS-ER.schema.json#",
"version": "25.01.30",
"version": "25.02.09",
"example": "example.json#",
"type": "object",
"title": "resourcesEngagement",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/json-schema/RS-ERROR.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "classpath:/json-schema/schema#",
"x-id": "RS-ERROR.schema.json#",
"version": "25.01.30",
"version": "25.02.09",
"example": "example.json#",
"type": "object",
"title": "error",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/json-schema/RS-RI.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "classpath:/json-schema/schema#",
"x-id": "RS-RI.schema.json#",
"version": "25.01.30",
"version": "25.02.09",
"example": "example.json#",
"type": "object",
"title": "resourcesInfo",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/json-schema/RS-RPIS.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "classpath:/json-schema/schema#",
"x-id": "RS-RPIS.schema.json#",
"version": "25.01.30",
"version": "25.02.09",
"example": "example.json#",
"type": "object",
"title": "rpis",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/json-schema/RS-RR.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "classpath:/json-schema/schema#",
"x-id": "RS-RR.schema.json#",
"version": "25.01.30",
"version": "25.02.09",
"example": "example.json#",
"type": "object",
"title": "resourcesResponse",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/json-schema/RS-SR.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "classpath:/json-schema/schema#",
"x-id": "RS-SR.schema.json#",
"version": "25.01.30",
"version": "25.02.09",
"example": "example.json#",
"type": "object",
"title": "resourcesStatus",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/json-schema/RS-URL.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "classpath:/json-schema/schema#",
"x-id": "RS-URL.schema.json#",
"version": "25.01.30",
"version": "25.02.09",
"example": "example.json#",
"type": "object",
"title": "documentLink",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/json-schema/TECHNICAL.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "classpath:/json-schema/schema#",
"x-id": "TECHNICAL.schema.json#",
"version": "25.01.30",
"version": "25.02.09",
"example": "example.json#",
"type": "object",
"title": "technical",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/json-schema/TECHNICAL_NOREQ.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "classpath:/json-schema/schema#",
"x-id": "TECHNICAL_NOREQ.schema.json#",
"version": "25.01.30",
"version": "25.02.09",
"example": "example.json#",
"type": "object",
"title": "technicalNoreq",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/json-schema/customContent.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "classpath:/json-schema/schema#",
"x-id": "customContent.schema.json#",
"version": "25.01.30",
"version": "25.02.09",
"example": "example.json#",
"type": "object",
"title": "customContent",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/sample/valid/TECHNICAL/complete.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"phoneNumberField": "0123456789",
"dateField": "2020-01-01",
"emailField": "[email protected]",
"datetimeField": "2022-09-27T08:25:54+02:00",
"datetimeField": "2022-09-27T08:25:54+00:00",
"objectLevel1": {
"object1Level2": {
"object1Level3": {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/sample/valid/TECHNICAL/complete.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<phoneNumberField>0123456789</phoneNumberField>
<dateField>2020-01-01</dateField>
<emailField>[email protected]</emailField>
<datetimeField>2022-09-27T08:25:54+02:00</datetimeField>
<datetimeField>2022-09-27T08:25:54+00:00</datetimeField>
<objectLevel1>
<object1Level2>
<object1Level3>
Expand Down
Loading

0 comments on commit 37933fc

Please sign in to comment.