Android Question HL7 v2.4

DonManfred

Expert
Licensed User
Longtime User
What is hl7?
 
Upvote 0

FelixCusi

Member
Licensed User
Definition / general
  • Developed by Health Level Seven International (HL7.org), HL7 version 2.x (V2) is currently the most widely used messaging standard for electronic transmission of information across health enterprises and health information systems
It is a protocol for sending and receiving information. What I don't know is how to send the commands from my android app

atte
Felix
 
Upvote 0

FelixCusi

Member
Licensed User
check again and this web service works like this, you must send an xml and the server responds with an xml. That would be the query how to send and receive an xml?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Basically you can do the communication with okhttputils2.

But the xml and the communication needs encryption, ack-Requests-answers and more.

The HAPI java library is a java library which does all this in java. But i´m not sure if it is compatible with android. Maybe only b4j

Without some knowledge about the Protocol used (and SOAP-Requests) it will be trivial to build something.

I do not know anything released. You need to build it by yourself i guess.

Search the forum about okhttputils2 and SOAP Reuests. Soap request are asked in the past multiple times.
 
Last edited:
Upvote 0

FelixCusi

Member
Licensed User
Hi
have this server data to connect and send an xml

Test Associate: 121297/00
Method: Message (Passport, Message)
Parameter 1: Passport, report 8 (HL7 v2.4)
Parameter 2: Message HL7

The xml I send as an example is

example of shipping xml::
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://servicio.hl7v24.sancorsalud.com.ar/">
   <soapenv:Header/>
   <soapenv:Body>
      <ser:Message>
         <pasaporte>0</pasaporte>
         <mensaje>MSH|^~\{|TRIT0100M|TRIT00999999|SANCOR_SALUD|SANCOR_SALUD^604940^IIN|20170912144551||ZQI^Z01^ZQI_Z01|17091214455180419558|P|2.4|||NE|AL|ARG
         PRD|PS^Prestador Solicitante||||||22^PR|
         PID|||121297^0^^SANCOR_SALUD^HC||UNKNOWN</mensaje>
      </ser:Message>
   </soapenv:Body>
</soapenv:Envelope>

The server response xml should be:
The server response xml::
<?xml version="1.0" encoding="UTF-8"?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
   <S:Body>
      <ns2:MessageResponse xmlns:ns2="http://servicio.hl7v24.sancorsalud.com.ar/">
         <resultado>MSH|^~\&amp;|SANCOR_SALUD|SANCOR_SALUD^604940^IIN|TRIT0100M|TRIT00999999|20171004135034||ZPI^Z01^ZPI_Z01|70801|P|2.4|||NE|AL|ARG
MSA|AA|17091214455180419558
ZAU||3034675|B000^AUTORIZADA
PRD|PS^Prestador Solicitante|CTRO. PRIV. TOMOG. COMPUTADA C|||||22^PR
PID|1||121297^0^^SANCOR_SALUD^HC||A^.
IN1|1|S3000^SANCOR 3500|604940
ZIN|Y|GRAV^GRAV
NTE|1||AMS-SALUD</resultado>
      </ns2:MessageResponse>
   </S:Body>
</S:Envelope>

The b4a code is:
Code B4a:
    Dim requestSoapXML2 As String=$"<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://servicio.hl7v24.sancorsalud.com.ar/">
   <soapenv:Header/>
   <soapenv:Body>
      <ser:Message>
         <pasaporte>0</pasaporte>
         <mensaje>MSH|^~\{|TRIT0100M|TRIT00999999|SANCOR_SALUD|SANCOR_SALUD^604940^IIN|20170912144551||ZQI^Z01^ZQI_Z01|17091214455180419558|P|2.4|||NE|AL|ARG
         PRD|PS^Prestador Solicitante||||||22^PR|
         PID|||121297^0^^SANCOR_SALUD^HC||UNKNOWN</mensaje>
      </ser:Message>
   </soapenv:Body>
</soapenv:Envelope>"$

'    j.Initialize("j", Me)
'    j.GetRequest.SetHeader("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6")
'    j.PostString(xServer,xMensa)
    'j.Download(xServer)


    Dim j As HttpJob
    j.Initialize("j", Me)
'j.GetRequest.SetHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.92 Safari/537.36")
    'j.GetRequest.SetContentType("application/soap+xml; charset=utf-8")
    'J.GetRequest.SetHeader("SOAPAction", """http://servicio.hl7v24.sancorsalud.com.ar/""")
    'j.GetRequest.Timeout = DateTime.TicksPerSecond * 45
    'j.GetRequest.SetHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.92 Safari/537.36")
    
    'J.GetRequest.SetContentType("text/xml; charset=utf-8")
    j.PostString("https://testservicios.sancorsalud.com.ar/Autorizador/HL7v24",requestSoapXML2)
    'j.GetRequest.SetHeader("Content-Type", "Application/soap+xml; charset=utf-8")
    'j.GetRequest.SetHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.92 Safari/537.36")
    J.GetRequest.SetHeader("SOAPAction", """http://servicio.hl7v24.sancorsalud.com.ar/""")
End Sub
Sub JobDone (Job As HttpJob)
    Log("JobName = " & Job.JobName & ", Success = " & Job.Success)
    If Job.Success = True Then
        Log(Job.GetString)
    Else
        Log("Error: " & Job.ErrorMessage)
        ToastMessageShow("Error: " & Job.ErrorMessage, True)
    End If
    Job.Release
End Sub

I run it and it gives me this error:
ResponseError. Reason: javax.net.ssl.SSLHandshakeException: Connection closed by peer, Response:

Could it be that you are implementing it wrong?

Gracias
Felix

B4a v9.50
 
Upvote 0
Top