Sooooooooo ....
Its SIMPLE as that : 
I dont know why Intersystem didnt use the same logic used for HL7 messages...
- Log in to post comments
Sooooooooo ....
Its SIMPLE as that : 
I dont know why Intersystem didnt use the same logic used for HL7 messages...
Solved.
Misconfiguration in the firewall.
Thanks everyone.
Hello.
I asked the API's owner. He doesn't have any filtering :/
Yes. Production : .png)
Test : .png)
I tried it.
Same error.
Hello.
Like this ? :.png)
Solved.
Fixed with ZCONVERT :
set SignaletiquePat.internalID = $ZCONVERT("050522001","O","UTF8")
set SignaletiquePat.lastName = $ZCONVERT("Tata","O","UTF8")
set SignaletiquePat.firstName = $ZCONVERT("Silva","O","UTF8")
set SignaletiquePat.dateOfBirth = $ZCONVERT("05/05/2022","O","UTF8")
set SignaletiquePat.gender = "1"
set SignaletiquePat.clinicId = 22
set SignaletiquePat.mothersName = $ZCONVERT("Anne Dede","O","UTF8")
set SignaletiquePat.address = $ZCONVERT("Rue des prés, 50","O","UTF8")
set SignaletiquePat.postalCode = "4620"
set SignaletiquePat.place = $ZCONVERT("Fléron","O","UTF8")
set SignaletiquePat.telephone1 = $ZCONVERT("0499998855","O","UTF8")Like the doc said for .%ToJSON :
NOTE: RFC 7159 specifies that the default encoding for JSON values uses UTF-8. When writing a stream containing 8-bit characters this implies that it may be necessary to explicitly convert individual values via a call to $ZCONVERT (e.g. $zcvt(value,"O","UTF8") ) or entire streams by setting the TranslateTable attribute of the stream to "UTF8"
https://docs.intersystems.com/irislatest/csp/documatic/%25CSP.Documatic…
Or is this the %ToJSON() that failed to translate correctly ?
Hey !
I found what was the problem.... Look a this, i used Postman as proxy for my request.
I found this issue with ''é" .png)
Then i replace "é" with "e" and it worked !
.png)
Do you know if studio has spécial encoding character ?
How can i fix this ?
Thanks.
.png)
My Body is not empty..... i dont know anymore lol.
Same error : HTTP 500 from the server... I guess its a empty body request again :
Here is the update code :
Method SendSignaletique(Token As %String)
{
set UrlPats = "https://app.depistagesurdite.be/externaldemo"
/*set internalID = "123456789"
set lastName = "Test"
set firstName = "CHRV"
set dateOfBirth = "2022-05-04"
set gender = "1"
set clinicId = 22
set mothersName = "CHR VERVIERS"
set address = "Rue du parc , 29"
set postalCode = 4800
set place ="Verviers"
set telephone1 = "087212824"*/
try
{
set JsonArray = []
set SignaletiquePat = {}
set SignaletiquePat.internalID = "050522001"
set SignaletiquePat.lastName = "Tata"
set SignaletiquePat.firstName = "Silva"
set SignaletiquePat.dateOfBirth = "05/05/2022"
set SignaletiquePat.gender = "1"
set SignaletiquePat.clinicId = 22
set SignaletiquePat.mothersName = "Anne Dede"
set SignaletiquePat.address = "Rue des prés, 50"
set SignaletiquePat.postalCode = "4620"
set SignaletiquePat.place = "fléron"
set SignaletiquePat.telephone1 = "0499998855"
Do JsonArray.%Push(SignaletiquePat)
set JsonArrayOBJ = JsonArray.%ToJSON()
$$$TRACE("Json signalétique patient : " _JsonArrayOBJ)
set HTTPRequestPat = ##class(%Net.HttpRequest).%New()
set HTTPRequestPat.ContentType = "application/json"
Do HTTPRequestPat.SetHeader("Authorization","Bearer "_Token)
Do HTTPRequestPat.EntityBody.Write(JsonArrayOBJ)
set ..Adapter.URL = UrlPats_"/api/patient/signaletic"
set st = ..Adapter.SendFormDataURL(..Adapter.URL,.callResponsePat,"POST",HTTPRequestPat)
if ($$$ISERR(st))
{
throw ##class(%Exception.StatusException).CreateFromStatus(st)
}
#dim callResponsePat as %Net.HttpResponse
set dynamicObject = {}.%FromJSON(callResponsePat.Data)
$$$TRACE("HTTP status : "_ callResponsePat.StatusCode)
set JsonString = dynamicObject.%ToJSON()
$$$TRACE("retour ajout patient : " _ JsonString)
set Iterator = dynamicObject.%GetIterator()
While Iterator.%GetNext(.key,.val)
{
if (key = "Message")
{
if (val = "Une erreur s’est produite.")
{
$$$TRACE("Erreur : "_ val)
}
else
{
$$$TRACE("pas d'erreur : " _val)
}
}
}
}
catch ex
{
$$$TRACE("Erreur lors de l'envoi de la signalétique : "_ex.DisplayString())
}
}Thanks. I did it but it didnt work :/
Ok i will try with a check of an error.
However the webservice provider told me he got an empty request everytime...
Hi.
Its already a Json :
set SignaletiquePat.internalID = "050522001" set SignaletiquePat.lastName = "Tata" set SignaletiquePat.firstName = "Silva" set SignaletiquePat.dateOfBirth = "05/05/2022" set SignaletiquePat.gender = "1" set SignaletiquePat.clinicId = 22 set SignaletiquePat.mothersName = "Anne Dede" set SignaletiquePat.address = "Rue des prés, 50" set SignaletiquePat.postalCode = "4620" set SignaletiquePat.place = "fléron" set SignaletiquePat.telephone1 = "0499998855" set JsonArray."0" = SignaletiquePat set JsonArrayOBJ = JsonArray.%ToJSON()
Hi i think i already tried and it didnt work
Hi guys.
It was simple.. I just had to create a SSL config for the communication...
SOAP ui etc did it automatcly ...
Thanks all.
Hello.
Thanks you for your response.
I will check theses.
Have a good day.
Thomas.