diff --git a/csv_parser/csv_parser.py b/csv_parser/csv_parser.py index 27973141f..705085cf8 100644 --- a/csv_parser/csv_parser.py +++ b/csv_parser/csv_parser.py @@ -291,7 +291,8 @@ def get_element_with_its_children(previous_children, elem_id): # DATA USAGE def is_array(elem): """Is elem an array?""" - return elem['Cardinalité'].endswith('n') + cardinality = elem['Cardinalité'] + return not cardinality.endswith('1') def navigate_children_with_id(id_path): """ @@ -402,6 +403,8 @@ def add_field_child_property(parent, child, definitions): 'x-health-only': child['is_health_only'], 'items': childDetails } + if child['Cardinalité'][-1].isdigit(): + properties[child['name']]['maxItems'] = int(child['Cardinalité'][-1]) else: properties[child['name']] = childDetails @@ -434,6 +437,8 @@ def add_object_child_definition(parent, child, definitions): '$ref': '#/definitions/' + childTypeName, } } + if child['Cardinalité'][-1].isdigit(): + properties[child['name']]['maxItems'] = int(child['Cardinalité'][-1]) else: properties[child['name']] = { '$ref': '#/definitions/' + childTypeName, diff --git a/csv_parser/json_schema2xsd/src/main/resources/EMSI.schema.json b/csv_parser/json_schema2xsd/src/main/resources/EMSI.schema.json index 56c1a6224..0187dd886 100644 --- a/csv_parser/json_schema2xsd/src/main/resources/EMSI.schema.json +++ b/csv_parser/json_schema2xsd/src/main/resources/EMSI.schema.json @@ -2,7 +2,7 @@ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "classpath:/json-schema/schema#", "x-id": "EMSI.schema.json#", - "version": "24.01.23", + "version": "24.02.13", "example": "example.json#", "type": "object", "title": "emsi", diff --git a/csv_parser/json_schema2xsd/src/main/resources/RC-EDA.schema.json b/csv_parser/json_schema2xsd/src/main/resources/RC-EDA.schema.json index 55bb0c979..a4146f5a3 100644 --- a/csv_parser/json_schema2xsd/src/main/resources/RC-EDA.schema.json +++ b/csv_parser/json_schema2xsd/src/main/resources/RC-EDA.schema.json @@ -2,7 +2,7 @@ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "classpath:/json-schema/schema#", "x-id": "RC-EDA.schema.json#", - "version": "24.01.23", + "version": "24.02.13", "example": "example.json#", "type": "object", "title": "createCase", @@ -525,7 +525,11 @@ "required": [], "properties": { "customMap": { - "$ref": "#/definitions/customMap" + "type": "array", + "items": { + "$ref": "#/definitions/customMap" + }, + "maxItems": 3 } }, "additionalProperties": false, @@ -1531,7 +1535,7 @@ "title": "Cl\u00e9", "x-health-only": false, "x-cols": 6, - "example": "example.json#/createCase/additionalInformation/customMap/key", + "example": "example.json#/createCase/additionalInformation/customMap/0/key", "description": "Nom de la balise" }, "label": { @@ -1539,7 +1543,7 @@ "title": "Libell\u00e9", "x-health-only": false, "x-cols": 6, - "example": "example.json#/createCase/additionalInformation/customMap/label", + "example": "example.json#/createCase/additionalInformation/customMap/0/label", "description": "Libell\u00e9 correspondant" }, "value": { @@ -1547,7 +1551,7 @@ "title": "Valeur", "x-health-only": false, "x-cols": 6, - "example": "example.json#/createCase/additionalInformation/customMap/value", + "example": "example.json#/createCase/additionalInformation/customMap/0/value", "description": "Valeur associ\u00e9e \u00e0 la cl\u00e9" }, "freetext": { @@ -1555,12 +1559,12 @@ "title": "D\u00e9tails", "x-health-only": false, "x-cols": 6, - "example": "example.json#/createCase/additionalInformation/customMap/freetext", + "example": "example.json#/createCase/additionalInformation/customMap/0/freetext", "description": "Informations compl\u00e9mentaires sur le contexte / utilisation de ce matching additionnel" } }, "additionalProperties": false, - "example": "example.json#/createCase/additionalInformation/customMap" + "example": "example.json#/createCase/additionalInformation/customMap/0" } } } \ No newline at end of file diff --git a/csv_parser/json_schema2xsd/src/main/resources/RS-EDA.schema.json b/csv_parser/json_schema2xsd/src/main/resources/RS-EDA.schema.json index 313569b32..50df026b2 100644 --- a/csv_parser/json_schema2xsd/src/main/resources/RS-EDA.schema.json +++ b/csv_parser/json_schema2xsd/src/main/resources/RS-EDA.schema.json @@ -2,7 +2,7 @@ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "classpath:/json-schema/schema#", "x-id": "RS-EDA.schema.json#", - "version": "24.01.23", + "version": "24.02.13", "example": "example.json#", "type": "object", "title": "createCase", @@ -658,7 +658,11 @@ "required": [], "properties": { "customMap": { - "$ref": "#/definitions/customMap" + "type": "array", + "items": { + "$ref": "#/definitions/customMap" + }, + "maxItems": 3 } }, "additionalProperties": false, @@ -2182,7 +2186,7 @@ "title": "Cl\u00e9", "x-health-only": false, "x-cols": 6, - "example": "example.json#/createCaseHealth/additionalInformation/customMap/key", + "example": "example.json#/createCaseHealth/additionalInformation/customMap/0/key", "description": "Nom de la balise" }, "label": { @@ -2190,7 +2194,7 @@ "title": "Libell\u00e9", "x-health-only": false, "x-cols": 6, - "example": "example.json#/createCaseHealth/additionalInformation/customMap/label", + "example": "example.json#/createCaseHealth/additionalInformation/customMap/0/label", "description": "Libell\u00e9 correspondant" }, "value": { @@ -2198,7 +2202,7 @@ "title": "Valeur", "x-health-only": false, "x-cols": 6, - "example": "example.json#/createCaseHealth/additionalInformation/customMap/value", + "example": "example.json#/createCaseHealth/additionalInformation/customMap/0/value", "description": "Valeur associ\u00e9e \u00e0 la cl\u00e9" }, "freetext": { @@ -2206,12 +2210,12 @@ "title": "D\u00e9tails", "x-health-only": false, "x-cols": 6, - "example": "example.json#/createCaseHealth/additionalInformation/customMap/freetext", + "example": "example.json#/createCaseHealth/additionalInformation/customMap/0/freetext", "description": "Informations compl\u00e9mentaires sur le contexte / utilisation de ce matching additionnel" } }, "additionalProperties": false, - "example": "example.json#/createCaseHealth/additionalInformation/customMap" + "example": "example.json#/createCaseHealth/additionalInformation/customMap/0" } } } \ No newline at end of file diff --git a/csv_parser/out/EMSI/EMSI.schema.docx b/csv_parser/out/EMSI/EMSI.schema.docx index eb8d9ae94..4657b8bf9 100644 Binary files a/csv_parser/out/EMSI/EMSI.schema.docx and b/csv_parser/out/EMSI/EMSI.schema.docx differ diff --git a/csv_parser/out/EMSI/EMSI.uml_diagram.pdf b/csv_parser/out/EMSI/EMSI.uml_diagram.pdf index b7a7bf398..43afd72f8 100644 Binary files a/csv_parser/out/EMSI/EMSI.uml_diagram.pdf and b/csv_parser/out/EMSI/EMSI.uml_diagram.pdf differ diff --git a/csv_parser/out/RC-EDA/RC-EDA.example.json b/csv_parser/out/RC-EDA/RC-EDA.example.json index 1d252d4ef..db72e7458 100644 --- a/csv_parser/out/RC-EDA/RC-EDA.example.json +++ b/csv_parser/out/RC-EDA/RC-EDA.example.json @@ -127,12 +127,14 @@ {} ], "additionalInformation": { - "customMap": { - "key": "neighborhood", - "label": "Quartier", - "value": "LYON 2e arrondissement", - "freetext": "Pr\u00e9cision sur le quartier d'intervention" - } + "customMap": [ + { + "key": "neighborhood", + "label": "Quartier", + "value": "LYON 2e arrondissement", + "freetext": "Pr\u00e9cision sur le quartier d'intervention" + } + ] }, "freetext": "None" } diff --git a/csv_parser/out/RC-EDA/RC-EDA.schema.docx b/csv_parser/out/RC-EDA/RC-EDA.schema.docx index 259883ef5..9da368068 100644 Binary files a/csv_parser/out/RC-EDA/RC-EDA.schema.docx and b/csv_parser/out/RC-EDA/RC-EDA.schema.docx differ diff --git a/csv_parser/out/RC-EDA/RC-EDA.uml_diagram b/csv_parser/out/RC-EDA/RC-EDA.uml_diagram index 2c91c3b73..2b9c72d58 100644 --- a/csv_parser/out/RC-EDA/RC-EDA.uml_diagram +++ b/csv_parser/out/RC-EDA/RC-EDA.uml_diagram @@ -289,7 +289,7 @@ strict digraph { objet customMapkey string : [1..1] label string : [0..1] value string : [1..1] freetext string : [0..1] >] - customMap -> additionalInformation [constraint=true headlabel=1 taillabel="0..1"] + customMap -> additionalInformation [constraint=true headlabel=1 taillabel="0..*"] additionalInformation [label=< diff --git a/csv_parser/out/RC-EDA/RC-EDA.uml_diagram.pdf b/csv_parser/out/RC-EDA/RC-EDA.uml_diagram.pdf index ba5f5c309..b252cddcb 100644 Binary files a/csv_parser/out/RC-EDA/RC-EDA.uml_diagram.pdf and b/csv_parser/out/RC-EDA/RC-EDA.uml_diagram.pdf differ diff --git a/csv_parser/out/RS-EDA/RS-EDA.example.json b/csv_parser/out/RS-EDA/RS-EDA.example.json index 32b88dc40..2027dc491 100644 --- a/csv_parser/out/RS-EDA/RS-EDA.example.json +++ b/csv_parser/out/RS-EDA/RS-EDA.example.json @@ -232,12 +232,14 @@ {} ], "additionalInformation": { - "customMap": { - "key": "neighborhood", - "label": "Quartier", - "value": "LYON 2e arrondissement", - "freetext": "Pr\u00e9cision sur le quartier d'intervention" - } + "customMap": [ + { + "key": "neighborhood", + "label": "Quartier", + "value": "LYON 2e arrondissement", + "freetext": "Pr\u00e9cision sur le quartier d'intervention" + } + ] }, "freetext": "None" } diff --git a/csv_parser/out/RS-EDA/RS-EDA.schema.docx b/csv_parser/out/RS-EDA/RS-EDA.schema.docx index d0251c155..34efde0c9 100644 Binary files a/csv_parser/out/RS-EDA/RS-EDA.schema.docx and b/csv_parser/out/RS-EDA/RS-EDA.schema.docx differ diff --git a/csv_parser/out/RS-EDA/RS-EDA.uml_diagram b/csv_parser/out/RS-EDA/RS-EDA.uml_diagram index cd6bc9f9b..aa3c24983 100644 --- a/csv_parser/out/RS-EDA/RS-EDA.uml_diagram +++ b/csv_parser/out/RS-EDA/RS-EDA.uml_diagram @@ -541,7 +541,7 @@ strict digraph {
additionalInformation
objet customMap
key string : [1..1]
label string : [0..1]
value string : [1..1]
freetext string : [0..1]
>] - customMap -> additionalInformation [constraint=true headlabel=1 taillabel="0..1"] + customMap -> additionalInformation [constraint=true headlabel=1 taillabel="0..*"] additionalInformation [label=< diff --git a/csv_parser/out/RS-EDA/RS-EDA.uml_diagram.pdf b/csv_parser/out/RS-EDA/RS-EDA.uml_diagram.pdf index 67b93a89b..0c0f5c795 100644 Binary files a/csv_parser/out/RS-EDA/RS-EDA.uml_diagram.pdf and b/csv_parser/out/RS-EDA/RS-EDA.uml_diagram.pdf differ diff --git a/csv_parser/out/hubsante.asyncapi.yaml b/csv_parser/out/hubsante.asyncapi.yaml index 59608e6d6..07843d3ca 100644 --- a/csv_parser/out/hubsante.asyncapi.yaml +++ b/csv_parser/out/hubsante.asyncapi.yaml @@ -841,7 +841,10 @@ components: required: [] properties: customMap: - $ref: '#/components/schemas/customMap' + type: array + items: + $ref: '#/components/schemas/customMap' + maxItems: 3 additionalProperties: false example: example.json#/createCaseHealth/additionalInformation nomenclature: @@ -1921,7 +1924,7 @@ components: title: "Cl\xE9" x-health-only: false x-cols: 6 - example: example.json#/createCaseHealth/additionalInformation/customMap/key + example: example.json#/createCaseHealth/additionalInformation/customMap/0/key description: Nom de la balise examples: - neighborhood @@ -1930,7 +1933,7 @@ components: title: "Libell\xE9" x-health-only: false x-cols: 6 - example: example.json#/createCaseHealth/additionalInformation/customMap/label + example: example.json#/createCaseHealth/additionalInformation/customMap/0/label description: "Libell\xE9 correspondant" examples: - Quartier @@ -1939,7 +1942,7 @@ components: title: Valeur x-health-only: false x-cols: 6 - example: example.json#/createCaseHealth/additionalInformation/customMap/value + example: example.json#/createCaseHealth/additionalInformation/customMap/0/value description: "Valeur associ\xE9e \xE0 la cl\xE9" examples: - LYON 2e arrondissement @@ -1948,13 +1951,13 @@ components: title: "D\xE9tails" x-health-only: false x-cols: 6 - example: example.json#/createCaseHealth/additionalInformation/customMap/freetext + example: example.json#/createCaseHealth/additionalInformation/customMap/0/freetext description: "Informations compl\xE9mentaires sur le contexte / utilisation\ \ de ce matching additionnel" examples: - "Pr\xE9cision sur le quartier d'intervention" additionalProperties: false - example: example.json#/createCaseHealth/additionalInformation/customMap + example: example.json#/createCaseHealth/additionalInformation/customMap/0 examples: - key: neighborhood label: Quartier diff --git a/generator/input/RC-EDA.openapi.yaml b/generator/input/RC-EDA.openapi.yaml index 79e6919bf..dfd75c5aa 100644 --- a/generator/input/RC-EDA.openapi.yaml +++ b/generator/input/RC-EDA.openapi.yaml @@ -550,7 +550,10 @@ components: required: [] properties: customMap: - $ref: '#/components/schemas/customMap' + type: array + items: + $ref: '#/components/schemas/customMap' + maxItems: 3 additionalProperties: false example: example.json#/createCase/additionalInformation nomenclature: @@ -1679,7 +1682,7 @@ components: title: "Cl\xE9" x-health-only: false x-cols: 6 - example: example.json#/createCase/additionalInformation/customMap/key + example: example.json#/createCase/additionalInformation/customMap/0/key description: Nom de la balise examples: - neighborhood @@ -1688,7 +1691,7 @@ components: title: "Libell\xE9" x-health-only: false x-cols: 6 - example: example.json#/createCase/additionalInformation/customMap/label + example: example.json#/createCase/additionalInformation/customMap/0/label description: "Libell\xE9 correspondant" examples: - Quartier @@ -1697,7 +1700,7 @@ components: title: Valeur x-health-only: false x-cols: 6 - example: example.json#/createCase/additionalInformation/customMap/value + example: example.json#/createCase/additionalInformation/customMap/0/value description: "Valeur associ\xE9e \xE0 la cl\xE9" examples: - LYON 2e arrondissement @@ -1706,13 +1709,13 @@ components: title: "D\xE9tails" x-health-only: false x-cols: 6 - example: example.json#/createCase/additionalInformation/customMap/freetext + example: example.json#/createCase/additionalInformation/customMap/0/freetext description: "Informations compl\xE9mentaires sur le contexte / utilisation\ \ de ce matching additionnel" examples: - "Pr\xE9cision sur le quartier d'intervention" additionalProperties: false - example: example.json#/createCase/additionalInformation/customMap + example: example.json#/createCase/additionalInformation/customMap/0 examples: - key: neighborhood label: Quartier diff --git a/generator/input/RS-EDA.openapi.yaml b/generator/input/RS-EDA.openapi.yaml index 339575f62..d0d46ad13 100644 --- a/generator/input/RS-EDA.openapi.yaml +++ b/generator/input/RS-EDA.openapi.yaml @@ -679,7 +679,10 @@ components: required: [] properties: customMap: - $ref: '#/components/schemas/customMap' + type: array + items: + $ref: '#/components/schemas/customMap' + maxItems: 3 additionalProperties: false example: example.json#/createCaseHealth/additionalInformation nomenclature: @@ -2383,7 +2386,7 @@ components: title: "Cl\xE9" x-health-only: false x-cols: 6 - example: example.json#/createCaseHealth/additionalInformation/customMap/key + example: example.json#/createCaseHealth/additionalInformation/customMap/0/key description: Nom de la balise examples: - neighborhood @@ -2392,7 +2395,7 @@ components: title: "Libell\xE9" x-health-only: false x-cols: 6 - example: example.json#/createCaseHealth/additionalInformation/customMap/label + example: example.json#/createCaseHealth/additionalInformation/customMap/0/label description: "Libell\xE9 correspondant" examples: - Quartier @@ -2401,7 +2404,7 @@ components: title: Valeur x-health-only: false x-cols: 6 - example: example.json#/createCaseHealth/additionalInformation/customMap/value + example: example.json#/createCaseHealth/additionalInformation/customMap/0/value description: "Valeur associ\xE9e \xE0 la cl\xE9" examples: - LYON 2e arrondissement @@ -2410,13 +2413,13 @@ components: title: "D\xE9tails" x-health-only: false x-cols: 6 - example: example.json#/createCaseHealth/additionalInformation/customMap/freetext + example: example.json#/createCaseHealth/additionalInformation/customMap/0/freetext description: "Informations compl\xE9mentaires sur le contexte / utilisation\ \ de ce matching additionnel" examples: - "Pr\xE9cision sur le quartier d'intervention" additionalProperties: false - example: example.json#/createCaseHealth/additionalInformation/customMap + example: example.json#/createCaseHealth/additionalInformation/customMap/0 examples: - key: neighborhood label: Quartier diff --git a/src/main/java/com/hubsante/model/cisu/AdditionalInformation.java b/src/main/java/com/hubsante/model/cisu/AdditionalInformation.java index 04e0962cd..4bd4c4225 100644 --- a/src/main/java/com/hubsante/model/cisu/AdditionalInformation.java +++ b/src/main/java/com/hubsante/model/cisu/AdditionalInformation.java @@ -35,8 +35,10 @@ import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.dataformat.xml.annotation.*; import com.hubsante.model.cisu.CustomMap; +import java.util.ArrayList; import java.util.Arrays; import java.util.Arrays; +import java.util.List; import java.util.Objects; /** @@ -48,16 +50,24 @@ public class AdditionalInformation { public static final String JSON_PROPERTY_CUSTOM_MAP = "customMap"; - private CustomMap customMap; + private List customMap; public AdditionalInformation() {} - public AdditionalInformation customMap(CustomMap customMap) { + public AdditionalInformation customMap(List customMap) { this.customMap = customMap; return this; } + public AdditionalInformation addCustomMapItem(CustomMap customMapItem) { + if (this.customMap == null) { + this.customMap = new ArrayList<>(); + } + this.customMap.add(customMapItem); + return this; + } + /** * Get customMap * @return customMap @@ -65,14 +75,22 @@ public AdditionalInformation customMap(CustomMap customMap) { @JsonProperty(JSON_PROPERTY_CUSTOM_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public CustomMap getCustomMap() { + public List getCustomMap() { return customMap; } + @JacksonXmlElementWrapper(useWrapping = false) + @JsonProperty(JSON_PROPERTY_CUSTOM_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCustomMap(CustomMap customMap) { - this.customMap = customMap; + public void setCustomMap(List customMap) { + if (customMap == null) { + return; + } + if (this.customMap == null) { + this.customMap = new ArrayList<>(); + } + this.customMap.addAll(customMap); } @Override diff --git a/src/main/java/com/hubsante/model/health/AdditionalInformation.java b/src/main/java/com/hubsante/model/health/AdditionalInformation.java index 6ac09933b..1437b7970 100644 --- a/src/main/java/com/hubsante/model/health/AdditionalInformation.java +++ b/src/main/java/com/hubsante/model/health/AdditionalInformation.java @@ -35,8 +35,10 @@ import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.dataformat.xml.annotation.*; import com.hubsante.model.health.CustomMap; +import java.util.ArrayList; import java.util.Arrays; import java.util.Arrays; +import java.util.List; import java.util.Objects; /** @@ -48,16 +50,24 @@ public class AdditionalInformation { public static final String JSON_PROPERTY_CUSTOM_MAP = "customMap"; - private CustomMap customMap; + private List customMap; public AdditionalInformation() {} - public AdditionalInformation customMap(CustomMap customMap) { + public AdditionalInformation customMap(List customMap) { this.customMap = customMap; return this; } + public AdditionalInformation addCustomMapItem(CustomMap customMapItem) { + if (this.customMap == null) { + this.customMap = new ArrayList<>(); + } + this.customMap.add(customMapItem); + return this; + } + /** * Get customMap * @return customMap @@ -65,14 +75,22 @@ public AdditionalInformation customMap(CustomMap customMap) { @JsonProperty(JSON_PROPERTY_CUSTOM_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public CustomMap getCustomMap() { + public List getCustomMap() { return customMap; } + @JacksonXmlElementWrapper(useWrapping = false) + @JsonProperty(JSON_PROPERTY_CUSTOM_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCustomMap(CustomMap customMap) { - this.customMap = customMap; + public void setCustomMap(List customMap) { + if (customMap == null) { + return; + } + if (this.customMap == null) { + this.customMap = new ArrayList<>(); + } + this.customMap.addAll(customMap); } @Override diff --git a/src/main/resources/json-schema/EMSI.schema.json b/src/main/resources/json-schema/EMSI.schema.json index 56c1a6224..0187dd886 100644 --- a/src/main/resources/json-schema/EMSI.schema.json +++ b/src/main/resources/json-schema/EMSI.schema.json @@ -2,7 +2,7 @@ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "classpath:/json-schema/schema#", "x-id": "EMSI.schema.json#", - "version": "24.01.23", + "version": "24.02.13", "example": "example.json#", "type": "object", "title": "emsi", diff --git a/src/main/resources/json-schema/RC-EDA.schema.json b/src/main/resources/json-schema/RC-EDA.schema.json index 55bb0c979..a4146f5a3 100644 --- a/src/main/resources/json-schema/RC-EDA.schema.json +++ b/src/main/resources/json-schema/RC-EDA.schema.json @@ -2,7 +2,7 @@ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "classpath:/json-schema/schema#", "x-id": "RC-EDA.schema.json#", - "version": "24.01.23", + "version": "24.02.13", "example": "example.json#", "type": "object", "title": "createCase", @@ -525,7 +525,11 @@ "required": [], "properties": { "customMap": { - "$ref": "#/definitions/customMap" + "type": "array", + "items": { + "$ref": "#/definitions/customMap" + }, + "maxItems": 3 } }, "additionalProperties": false, @@ -1531,7 +1535,7 @@ "title": "Cl\u00e9", "x-health-only": false, "x-cols": 6, - "example": "example.json#/createCase/additionalInformation/customMap/key", + "example": "example.json#/createCase/additionalInformation/customMap/0/key", "description": "Nom de la balise" }, "label": { @@ -1539,7 +1543,7 @@ "title": "Libell\u00e9", "x-health-only": false, "x-cols": 6, - "example": "example.json#/createCase/additionalInformation/customMap/label", + "example": "example.json#/createCase/additionalInformation/customMap/0/label", "description": "Libell\u00e9 correspondant" }, "value": { @@ -1547,7 +1551,7 @@ "title": "Valeur", "x-health-only": false, "x-cols": 6, - "example": "example.json#/createCase/additionalInformation/customMap/value", + "example": "example.json#/createCase/additionalInformation/customMap/0/value", "description": "Valeur associ\u00e9e \u00e0 la cl\u00e9" }, "freetext": { @@ -1555,12 +1559,12 @@ "title": "D\u00e9tails", "x-health-only": false, "x-cols": 6, - "example": "example.json#/createCase/additionalInformation/customMap/freetext", + "example": "example.json#/createCase/additionalInformation/customMap/0/freetext", "description": "Informations compl\u00e9mentaires sur le contexte / utilisation de ce matching additionnel" } }, "additionalProperties": false, - "example": "example.json#/createCase/additionalInformation/customMap" + "example": "example.json#/createCase/additionalInformation/customMap/0" } } } \ No newline at end of file diff --git a/src/main/resources/json-schema/RS-EDA.schema.json b/src/main/resources/json-schema/RS-EDA.schema.json index 313569b32..50df026b2 100644 --- a/src/main/resources/json-schema/RS-EDA.schema.json +++ b/src/main/resources/json-schema/RS-EDA.schema.json @@ -2,7 +2,7 @@ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "classpath:/json-schema/schema#", "x-id": "RS-EDA.schema.json#", - "version": "24.01.23", + "version": "24.02.13", "example": "example.json#", "type": "object", "title": "createCase", @@ -658,7 +658,11 @@ "required": [], "properties": { "customMap": { - "$ref": "#/definitions/customMap" + "type": "array", + "items": { + "$ref": "#/definitions/customMap" + }, + "maxItems": 3 } }, "additionalProperties": false, @@ -2182,7 +2186,7 @@ "title": "Cl\u00e9", "x-health-only": false, "x-cols": 6, - "example": "example.json#/createCaseHealth/additionalInformation/customMap/key", + "example": "example.json#/createCaseHealth/additionalInformation/customMap/0/key", "description": "Nom de la balise" }, "label": { @@ -2190,7 +2194,7 @@ "title": "Libell\u00e9", "x-health-only": false, "x-cols": 6, - "example": "example.json#/createCaseHealth/additionalInformation/customMap/label", + "example": "example.json#/createCaseHealth/additionalInformation/customMap/0/label", "description": "Libell\u00e9 correspondant" }, "value": { @@ -2198,7 +2202,7 @@ "title": "Valeur", "x-health-only": false, "x-cols": 6, - "example": "example.json#/createCaseHealth/additionalInformation/customMap/value", + "example": "example.json#/createCaseHealth/additionalInformation/customMap/0/value", "description": "Valeur associ\u00e9e \u00e0 la cl\u00e9" }, "freetext": { @@ -2206,12 +2210,12 @@ "title": "D\u00e9tails", "x-health-only": false, "x-cols": 6, - "example": "example.json#/createCaseHealth/additionalInformation/customMap/freetext", + "example": "example.json#/createCaseHealth/additionalInformation/customMap/0/freetext", "description": "Informations compl\u00e9mentaires sur le contexte / utilisation de ce matching additionnel" } }, "additionalProperties": false, - "example": "example.json#/createCaseHealth/additionalInformation/customMap" + "example": "example.json#/createCaseHealth/additionalInformation/customMap/0" } } } \ No newline at end of file diff --git a/src/main/resources/sample/examples/RC-EDA-usecase-Armaury-1.json b/src/main/resources/sample/examples/RC-EDA-usecase-Armaury-1.json index e93f55d25..eaf5277d5 100644 --- a/src/main/resources/sample/examples/RC-EDA-usecase-Armaury-1.json +++ b/src/main/resources/sample/examples/RC-EDA-usecase-Armaury-1.json @@ -189,12 +189,14 @@ ] }, "additionalInformation": { - "customMap": { - "key": "neighborhood", - "label": "Quartier", - "value": "LYON 2e arrondissement", - "freetext": "Une voix sens unique pour voiture + une voix bus" - } + "customMap": [ + { + "key": "neighborhood", + "label": "Quartier", + "value": "LYON 2e arrondissement", + "freetext": "Une voix sens unique pour voiture + une voix bus" + } + ] }, "freetext": "None" } diff --git a/src/main/resources/sample/examples/RS-EDA-usecase-AppelLimitrophe-2.json b/src/main/resources/sample/examples/RS-EDA-usecase-AppelLimitrophe-2.json index b8a980c72..3c3918077 100644 --- a/src/main/resources/sample/examples/RS-EDA-usecase-AppelLimitrophe-2.json +++ b/src/main/resources/sample/examples/RS-EDA-usecase-AppelLimitrophe-2.json @@ -184,12 +184,14 @@ "newAlert": [], "owner": "fr.health.samu780", "additionalInformation": { - "customMap": { - "key": "Aucune", - "label": "Aucun", - "value": "0", - "freetext": "rempli pour pallier au bug d'envoi" - } + "customMap": [ + { + "key": "Aucune", + "label": "Aucun", + "value": "0", + "freetext": "rempli pour pallier au bug d'envoi" + } + ] }, "patient": [], "operator": [] diff --git a/src/main/resources/sample/examples/RS-EDA-usecase-PartageDossier-1.json b/src/main/resources/sample/examples/RS-EDA-usecase-PartageDossier-1.json index 4264b1328..a33ff0750 100644 --- a/src/main/resources/sample/examples/RS-EDA-usecase-PartageDossier-1.json +++ b/src/main/resources/sample/examples/RS-EDA-usecase-PartageDossier-1.json @@ -171,12 +171,14 @@ "newAlert": [], "owner": "fr.health.samu770", "additionalInformation": { - "customMap": { - "key": "Aucune", - "label": "Aucun", - "value": "0", - "freetext": "rempli pour pallier au bug d'envoi" - } + "customMap": [ + { + "key": "Aucune", + "label": "Aucun", + "value": "0", + "freetext": "rempli pour pallier au bug d'envoi" + } + ] }, "patient": [], "operator": [] diff --git a/src/main/resources/sample/failing/RC-EDA/RC-EDA-missing-required-fields-old.json b/src/main/resources/sample/failing/RC-EDA/RC-EDA-missing-required-fields-old.json index 11ce3f489..38b95bf7a 100644 --- a/src/main/resources/sample/failing/RC-EDA/RC-EDA-missing-required-fields-old.json +++ b/src/main/resources/sample/failing/RC-EDA/RC-EDA-missing-required-fields-old.json @@ -158,12 +158,14 @@ "newAlert": null, "severity": "MINOR", "additionalInformation": { - "customMap": { - "key": "neighborhood", - "label": "Quartier", - "value": "SECT.QUARTIER HISTORIQUE", - "freetext": "Une voix sens unique pour voiture + une voix bus" - } + "customMap": [ + { + "key": "neighborhood", + "label": "Quartier", + "value": "SECT.QUARTIER HISTORIQUE", + "freetext": "Une voix sens unique pour voiture + une voix bus" + } + ] }, "freetext": "choc à la tête mais portait un casque de protection. 2ème victime n'a pas de blessures apparantes." } diff --git a/src/main/resources/sample/valid/RC-EDA/RC-EDA.json b/src/main/resources/sample/valid/RC-EDA/RC-EDA.json index f08c0daf2..8f067be45 100644 --- a/src/main/resources/sample/valid/RC-EDA/RC-EDA.json +++ b/src/main/resources/sample/valid/RC-EDA/RC-EDA.json @@ -177,12 +177,14 @@ ] }, "additionalInformation": { - "customMap": { - "key": "neighborhood", - "label": "Quartier", - "value": "LYON 2e arrondissement", - "freetext": "Précision sur le quartier d'intervention" - } + "customMap": [ + { + "key": "neighborhood", + "label": "Quartier", + "value": "LYON 2e arrondissement", + "freetext": "Précision sur le quartier d'intervention" + } + ] }, "freetext": "None" }
additionalInformation