Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions .pre-commit-config.yaml

This file was deleted.

11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,12 @@ Les contributions, *issues* & *pull requests* sont les bienvenues !

### Pre-commit

Ce projet utilise [pre-commit](https://pre-commit.com/) pour faciliter le travail du développeur et qu'il détecte des erreurs de format/lint/typing le plus rapidement possible.
Pour l'utiliser en local, exécuter les commandes suivantes :
Des hooks Git sont définis pour simplifier le travail des développeurs.

```bash
pip install pre-commit
pre-commit install
```
Pour les installer :

- Installer [lefthook](https://lefthook.dev/installation/index.html)
- Lancer à la racine du dépôt `lefthook install`

Avant chaque commit, les hooks seront exécutés automatiquement et le commit sera annulé si des erreurs sont détectées.

Expand Down
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.
4 changes: 3 additions & 1 deletion csv_parser/out/RC-RI/RC-RI.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@
},
"position": {
"datetime": "2022-09-27T08:23:34+02:00",
"speed": 34,
"coord": {
"lat": "48.866667",
"lon": "2.333333"
"lon": "2.333333",
"height": 120
}
},
"contact": {
Expand Down
8 changes: 5 additions & 3 deletions csv_parser/out/RC-RI/RC-RI.input.csv
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@ TRUE = DISPONIBLE
FALSE = INDISPONIBLE
VIDE = INCONNU",FALSE,availability,0..1,,boolean,
,Position du vecteur,,,,,Objet qui permet de transmettre la position du vecteur,,position,0..1,X,position,
,,Date/heure de la position,,,,A valoriser avec la date et heure associée à la position,2022-09-27T08:23:34+02:00,datetime,1..1,,datetime,
,,Date/heure de la position,,,,Date et heure de la dernière position connue,2022-09-27T08:23:34+02:00,datetime,1..1,,datetime,
,,Vitesse,,,,"Vitesse de la ressource enregistrée, exprimée en km/h",34,speed,0..1,,number,
,,Coordonnées de la position,,,,Objet qui permet de transmettre les coordonnées GPS du vecteur,,coord,1..1,X,coord,
,,,Latitude,,,A valoriser avec la latitude de la position,48.866667,lat,1..1,,number,
,,,Longitude,,,A valoriser avec la longitude de la position,2.333333,lon,1..1,,number,
,,,Latitude,,,"Dernière coordonnée x connue de la ressource, entre −90 and +90",48.866667,lat,1..1,,number,
,,,Longitude,,,"Dernière coordonnée y connue de la ressource, entre −180 and +180",2.333333,lon,1..1,,number,
,,,Altitude,,,"Dernière coordonnée z connue de la ressource, en mètres sans bornes",120,height,0..1,,number,
,Contact,,,,,"Objet qui permet de décrire le type et la valeur de l'URI utilisée par un contact, ici spécifiquement le contact du vecteur mobilisé.",,contact,0..1,X,contact,
,,Type de contact ,,,,A valoriser avec le type de l'URI utilisée. Cf nomenclature associée.,TEL,type,0..1,,string,NOMENCLATURE: HubSante.typeCom
,,URI du contact,,,,"A valoriser avec la valeur de l'URI utilisée
Expand Down
Binary file modified csv_parser/out/RC-RI/RC-RI.schema.docx
Binary file not shown.
4 changes: 2 additions & 2 deletions csv_parser/out/RC-RI/RC-RI.uml_diagram
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ strict digraph {
<TR>
<TD ><B>coord</B></TD>
</TR>
<TR><TD BORDER="0"><I>objet coord</I></TD></TR><TR><TD BORDER="0" >lat <I>number</I> : [1..1] </TD></TR><TR><TD BORDER="0" >lon <I>number</I> : [1..1] </TD></TR>
<TR><TD BORDER="0"><I>objet coord</I></TD></TR><TR><TD BORDER="0" >lat <I>number</I> : [1..1] </TD></TR><TR><TD BORDER="0" >lon <I>number</I> : [1..1] </TD></TR><TR><TD BORDER="0" >height <I>number</I> : [0..1] </TD></TR>
</TABLE>>]
coord -> position [headlabel=1 taillabel=1]
position [label=<<TABLE>
<TR>
<TD ><B>position</B></TD>
</TR>
<TR><TD BORDER="0"><I>objet position</I></TD></TR><TR><TD BORDER="0" >datetime <I>date-time</I> : [1..1] </TD></TR>
<TR><TD BORDER="0"><I>objet position</I></TD></TR><TR><TD BORDER="0" >datetime <I>date-time</I> : [1..1] </TD></TR><TR><TD BORDER="0" >speed <I>number</I> : [0..1] </TD></TR>
</TABLE>>]
position -> resource [headlabel=1 taillabel="0..1"]
contact [label=<<TABLE>
Expand Down
Binary file modified csv_parser/out/RC-RI/RC-RI.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-SAS-RDV/RS-SAS-RDV.schema.docx
Binary file not shown.
Binary file modified csv_parser/out/RS-SAS-RDV/RS-SAS-RDV.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.
28 changes: 25 additions & 3 deletions generator/input/RC-RI.openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -303,11 +303,20 @@ components:
x-health-only: false
x-cols: 6
example: example.json#/resource/0/position/datetime
description: "A valoriser avec la date et heure associ\xE9e \xE0 la position"
description: "Date et heure de la derni\xE8re position connue"
pattern: ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}[\-+]\d{2}:\d{2}$
format: date-time
examples:
- '2022-09-27T08:23:34+02:00'
speed:
type: number
title: Vitesse
x-health-only: false
x-cols: 6
example: example.json#/resource/0/position/speed
description: "Vitesse de la ressource enregistr\xE9e, exprim\xE9e en km/h"
examples:
- 34
coord:
$ref: '#/components/schemas/coord'
additionalProperties: false
Expand Down Expand Up @@ -368,7 +377,8 @@ components:
x-health-only: false
x-cols: 6
example: example.json#/resource/0/position/coord/lat
description: A valoriser avec la latitude de la position
description: "Derni\xE8re coordonn\xE9e x connue de la ressource, entre\
\ \u221290 and +90"
examples:
- '48.866667'
lon:
Expand All @@ -377,11 +387,23 @@ components:
x-health-only: false
x-cols: 6
example: example.json#/resource/0/position/coord/lon
description: A valoriser avec la longitude de la position
description: "Derni\xE8re coordonn\xE9e y connue de la ressource, entre\
\ \u2212180 and +180"
examples:
- '2.333333'
height:
type: number
title: Altitude
x-health-only: false
x-cols: 6
example: example.json#/resource/0/position/coord/height
description: "Derni\xE8re coordonn\xE9e z connue de la ressource, en m\xE8\
tres sans bornes"
examples:
- 120
additionalProperties: false
example: example.json#/resource/0/position/coord
examples:
- lat: '48.866667'
lon: '2.333333'
height: 120
10 changes: 10 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
pre-commit:
parallel: true
commands:
converter-format-fix:
root: "converter/"
run: uv run ruff format .
stage_fixed: true
converter-type-check:
root: "converter/"
run: uv run --active mypy .
39 changes: 34 additions & 5 deletions src/main/java/com/hubsante/model/cisu/resources/info/Coord.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
/**
* Coord
*/
@JsonPropertyOrder({Coord.JSON_PROPERTY_LAT, Coord.JSON_PROPERTY_LON})
@JsonPropertyOrder({Coord.JSON_PROPERTY_LAT, Coord.JSON_PROPERTY_LON,
Coord.JSON_PROPERTY_HEIGHT})
@JsonTypeName("coord")
@JsonInclude(JsonInclude.Include.NON_EMPTY)

Expand All @@ -53,6 +54,9 @@ public class Coord {
public static final String JSON_PROPERTY_LON = "lon";
private BigDecimal lon;

public static final String JSON_PROPERTY_HEIGHT = "height";
private BigDecimal height;

public Coord() {}

public Coord lat(BigDecimal lat) {
Expand All @@ -62,7 +66,7 @@ public Coord lat(BigDecimal lat) {
}

/**
* A valoriser avec la latitude de la position
* Dernière coordonnée x connue de la ressource, entre −90 and +90
* @return lat
**/
@JsonProperty(JSON_PROPERTY_LAT)
Expand All @@ -85,7 +89,7 @@ public Coord lon(BigDecimal lon) {
}

/**
* A valoriser avec la longitude de la position
* Dernière coordonnée y connue de la ressource, entre −180 and +180
* @return lon
**/
@JsonProperty(JSON_PROPERTY_LON)
Expand All @@ -101,6 +105,29 @@ public void setLon(BigDecimal lon) {
this.lon = lon;
}

public Coord height(BigDecimal height) {

this.height = height;
return this;
}

/**
* Dernière coordonnée z connue de la ressource, en mètres sans bornes
* @return height
**/
@JsonProperty(JSON_PROPERTY_HEIGHT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

public BigDecimal getHeight() {
return height;
}

@JsonProperty(JSON_PROPERTY_HEIGHT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setHeight(BigDecimal height) {
this.height = height;
}

@Override
public boolean equals(Object o) {
if (this == o) {
Expand All @@ -111,12 +138,13 @@ public boolean equals(Object o) {
}
Coord coord = (Coord)o;
return Objects.equals(this.lat, coord.lat) &&
Objects.equals(this.lon, coord.lon);
Objects.equals(this.lon, coord.lon) &&
Objects.equals(this.height, coord.height);
}

@Override
public int hashCode() {
return Objects.hash(lat, lon);
return Objects.hash(lat, lon, height);
}

@Override
Expand All @@ -125,6 +153,7 @@ public String toString() {
sb.append("class Coord {\n");
sb.append(" lat: ").append(toIndentedString(lat)).append("\n");
sb.append(" lon: ").append(toIndentedString(lon)).append("\n");
sb.append(" height: ").append(toIndentedString(height)).append("\n");
sb.append("}");
return sb.toString();
}
Expand Down
37 changes: 33 additions & 4 deletions src/main/java/com/hubsante/model/cisu/resources/info/Position.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.dataformat.xml.annotation.*;
import com.hubsante.model.cisu.resources.info.Coord;
import java.math.BigDecimal;
import java.time.OffsetDateTime;
import java.util.Arrays;
import java.util.Arrays;
Expand All @@ -43,15 +44,18 @@
/**
* Position
*/
@JsonPropertyOrder(
{Position.JSON_PROPERTY_DATETIME, Position.JSON_PROPERTY_COORD})
@JsonPropertyOrder({Position.JSON_PROPERTY_DATETIME,
Position.JSON_PROPERTY_SPEED, Position.JSON_PROPERTY_COORD})
@JsonTypeName("position")
@JsonInclude(JsonInclude.Include.NON_EMPTY)

public class Position {
public static final String JSON_PROPERTY_DATETIME = "datetime";
private OffsetDateTime datetime;

public static final String JSON_PROPERTY_SPEED = "speed";
private BigDecimal speed;

public static final String JSON_PROPERTY_COORD = "coord";
private Coord coord;

Expand All @@ -64,7 +68,7 @@ public Position datetime(OffsetDateTime datetime) {
}

/**
* A valoriser avec la date et heure associée à la position
* Date et heure de la dernière position connue
* @return datetime
**/
@JsonProperty(JSON_PROPERTY_DATETIME)
Expand All @@ -80,6 +84,29 @@ public void setDatetime(OffsetDateTime datetime) {
this.datetime = datetime;
}

public Position speed(BigDecimal speed) {

this.speed = speed;
return this;
}

/**
* Vitesse de la ressource enregistrée, exprimée en km/h
* @return speed
**/
@JsonProperty(JSON_PROPERTY_SPEED)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

public BigDecimal getSpeed() {
return speed;
}

@JsonProperty(JSON_PROPERTY_SPEED)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setSpeed(BigDecimal speed) {
this.speed = speed;
}

public Position coord(Coord coord) {

this.coord = coord;
Expand Down Expand Up @@ -113,19 +140,21 @@ public boolean equals(Object o) {
}
Position position = (Position)o;
return Objects.equals(this.datetime, position.datetime) &&
Objects.equals(this.speed, position.speed) &&
Objects.equals(this.coord, position.coord);
}

@Override
public int hashCode() {
return Objects.hash(datetime, coord);
return Objects.hash(datetime, speed, coord);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Position {\n");
sb.append(" datetime: ").append(toIndentedString(datetime)).append("\n");
sb.append(" speed: ").append(toIndentedString(speed)).append("\n");
sb.append(" coord: ").append(toIndentedString(coord)).append("\n");
sb.append("}");
return sb.toString();
Expand Down
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": "26.02.27",
"version": "26.03.23",
"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": "26.02.27",
"version": "26.03.23",
"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": "26.02.27",
"version": "26.03.23",
"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": "26.02.27",
"version": "26.03.23",
"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": "26.02.27",
"version": "26.03.23",
"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": "26.02.27",
"version": "26.03.23",
"example": "example.json#",
"type": "object",
"title": "createCase",
Expand Down
Loading
Loading