Beispiele
E-Rezept signieren mit erxProxy im server mode gestartet:
Output als QR Code im png Format (Base64 encoded byte stream)
Request
shellscript
curl --location 'http://localhost:8082/ePrescription/create?output-format=qrcode' \
--header 'Authorization: Bearer oauth:{auth handle}' \
--header 'Content-Type: text/plain' \
--data '@/path_to_erezept_input/erezept_gzipped.txt' \
--output '/path_to_outputfolder/qrcode.png'Response
shellscript
Base64 encoded byte stream -> png-DateiRückgabe als enkodierter json-String:
Request
shellscript
curl --location 'http://localhost:8082/ePrescription/create?output-format=data' \
--header 'Authorization: Bearer oauth:{auth handle}' \
--header 'Content-Type: text/plain' \
--data '@/path_to_erezept_input/erezept_gzipped.txt' \
--output '/path_to_outputfolder/signed_string.txt'Response (example)
shellscript
{
"SignedPrescriptionData":"https://eprescription.hin.ch/#CHMED16A1H4sIAAAAAAAA...w1tn9f7zY7k5vDAAA&i=Matthieu+Goltzen%C3%A9+%28HIN%7Cmatgol3%29&t=1687330170&s=3066023100d3e88260cc4f486e01015f910accf6909216aad533a110c8...81eb0846aea82fa16c1c70c0d51e156d3a6b28dbd291d6b2f42d837d"
}Achtung
Das retournierte json muss in einen Text String konvertiert werden, um die Validierung durchzuführen: jq -r '.["SignedPrescriptionData"]' erx_output_as_text.txt
E-Rezept signieren mit erxProxy im direct mode:
Dieser Modus wird vor allem für die lokale Entwicklung verwendet:
shellscript
./erxproxy eprescription create --env prod --token oauth:{auth_handle} -o /qrcodeimage.png -f qrcode /inputfile.txt