Skip to content

Commit 6b86d28

Browse files
EliNodenClemsazert
authored andcommitted
feat(converter): update README.md
1 parent eaa920b commit 6b86d28

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

converter/README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,43 @@ curl -X POST http://localhost:8080/convert \
113113
-H "Content-Type: application/json" \
114114
-d "$(jq --argjson usecase "$(cat ../src/main/resources/sample/examples/RS-EDA/RS-EDA-SMUR_FemmeEnceinte_DelphineVigneau.01.json)" '.sourceVersion = "v3" | .targetVersion = "v3" | .cisuConversion = true | .edxl.content[0].jsonContent.embeddedJsonContent.message |= (. + $usecase)' tests/fixtures/EDXL/edxl_envelope_health_to_fire.json)"
115115
```
116+
117+
### Helper script — `scripts/call_convert.sh`
118+
119+
Executable helper to call `/convert` quickly without building the payload by hand.
120+
121+
**Prerequisite**: local-dev setup running (see [launch local dev setup](https://github.com/ansforge/SAMU-Hub-Config/blob/main/tools/local-dev/README.md)).
122+
123+
Usage:
124+
125+
```bash
126+
scripts/call_convert.sh <sourceVersion> <targetVersion> <type> <useCase> [options]
127+
```
128+
129+
Positional args:
130+
- `sourceVersion`, `targetVersion`: `v1` | `v2` | `v3` | `vactive`
131+
- `type`: `HealthVersionConversion` | `CISUTranscoding` | `CISUVersionConversion` (see `ConversionType` in `converter/constants.py`)
132+
- `useCase`: local path to a JSON file **or** `http(s)://` URL of the message payload
133+
134+
Options:
135+
- `--envelope <path|url>`: EDXL envelope file or URL (default: `tests/fixtures/EDXL/edxl_envelope_health_to_health.json`)
136+
- `--converter_url <url>`: converter base URL, `/convert` is appended (default: `http://localhost:8083`)
137+
- `-h`, `--help`: show usage
138+
139+
Examples:
140+
141+
```bash
142+
# Local fixture, default envelope (health-to-health)
143+
scripts/call_convert.sh v3 v2 HealthVersionConversion tests/fixtures/RS-RI/RS-RI_V3.0_exhaustive_fill.json
144+
145+
# CISU transcoding with a custom envelope
146+
scripts/call_convert.sh v3 vactive CISUTranscoding ./tests/fixtures/RC-EDA/RC-EDA_required_fields.json \
147+
--envelope tests/fixtures/EDXL/edxl_envelope_fire_to_health.json
148+
149+
# Remote payload via URL
150+
scripts/call_convert.sh v3 vactive CISUTranscoding https://raw.githubusercontent.com/org/repo/main/sample.json
151+
152+
# Override endpoint (e.g. staging)
153+
scripts/call_convert.sh v3 vactive CISUTranscoding ./sample.json \
154+
--converter_url https://staging.example.com
155+
```

0 commit comments

Comments
 (0)