Examples
Sign an e-prescription running the erxProxy server mode:
Output as QR Code in 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/eprescription_gzipped.txt' \
--output '/path_to_outputfolder/qrcode.png'Response
shellscript
Base64 encoded byte stream -> png-DateiReturn as encoded 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 '@/Users/matgol2/Desktop/eprescription_json_gzipped.txt' \
--output '/Users/matgol2/Desktop/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
The returned json must be decoded correctly, e.g. to perform a validation: jq -r '.["SignedPrescriptionData"]' erx_output_as_text.txt
Sign an e-prescription using your local erxProxy:
This mode is mainly used for local development:
shellscript
./erxproxy eprescription create --env prod --token oauth:{auth_handle} -o /qrcodeimage.png -f qrcode /inputfile.txt