@@ -100,3 +100,43 @@ curl -X POST http://localhost:8080/convert \
100100 -H " Content-Type: application/json" \
101101 -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) "
102102```
103+
104+ ### Helper script — ` scripts/call_convert.sh `
105+
106+ Executable helper to call ` /convert ` quickly without building the payload by hand.
107+
108+ ** Prerequisite** : local-dev setup running (see [ launch local dev setup] ( https://github.com/ansforge/SAMU-Hub-Config/blob/main/tools/local-dev/README.md ) ).
109+
110+ Usage:
111+
112+ ``` bash
113+ scripts/call_convert.sh < sourceVersion> < targetVersion> < type> < useCase> [options]
114+ ```
115+
116+ Positional args:
117+ - ` sourceVersion ` , ` targetVersion ` : ` v1 ` | ` v2 ` | ` v3 ` | ` vactive `
118+ - ` type ` : ` HealthVersionConversion ` | ` CISUTranscoding ` | ` CISUVersionConversion ` (see ` ConversionType ` in ` converter/constants.py ` )
119+ - ` useCase ` : local path to a JSON file ** or** ` http(s):// ` URL of the message payload
120+
121+ Options:
122+ - ` --envelope <path|url> ` : EDXL envelope file or URL (default: ` tests/fixtures/EDXL/edxl_envelope_health_to_health.json ` )
123+ - ` --converter_url <url> ` : converter base URL, ` /convert ` is appended (default: ` http://localhost:8083 ` )
124+ - ` -h ` , ` --help ` : show usage
125+
126+ Examples:
127+
128+ ``` bash
129+ # Local fixture, default envelope (health-to-health)
130+ scripts/call_convert.sh v3 v2 HealthVersionConversion tests/fixtures/RS-RI/RS-RI_V3.0_exhaustive_fill.json
131+
132+ # CISU transcoding with a custom envelope
133+ scripts/call_convert.sh v3 vactive CISUTranscoding ./tests/fixtures/RC-EDA/RC-EDA_required_fields.json \
134+ --envelope tests/fixtures/EDXL/edxl_envelope_fire_to_health.json
135+
136+ # Remote payload via URL
137+ scripts/call_convert.sh v3 vactive CISUTranscoding https://raw.githubusercontent.com/org/repo/main/sample.json
138+
139+ # Override endpoint (e.g. staging)
140+ scripts/call_convert.sh v3 vactive CISUTranscoding ./sample.json \
141+ --converter_url https://staging.example.com
142+ ```
0 commit comments