Thank you. This practical lesson is really helpful. Thank you a lot to @Ben Spead and @Pravin Barton , thank you! 🙂🙂🙂
- Log in to post comments
Thank you. This practical lesson is really helpful. Thank you a lot to @Ben Spead and @Pravin Barton , thank you! 🙂🙂🙂
Thank you @Enrico Parisi . It helps us. Thank you a lot.
Thank you @Luis Angel Pérez Ramos for your reply, let's see:
When we click on the magnyfying glass of Llamadas:
.png)
We see all the 4 <call> checked.
We have removed the timeout:
.png)
And it behaves like this:
.png)
It does not wait, for the 4 calls ^
Could you help us?
Thanks @Mike.W for your reply and help.
We have written the timeout as 30 and as "30" and in both cases it behaves wrong. It justs receives the first <call> response and it continues the BPL execution flow, without waiting for the other 3 replies:
.png)
Being the setting as "30":
.png)
And behaves similar with a timeout of 30:
.png)
30:
.png)
We do not know why.
Thanks for your help.
Thank you @Luis Angel Pérez Ramos , for your time and help.
We have put together all the calls followed by the sync, all of them inside the scope and at the end, after the sync, the catchall, as follows:
.png)
Being the scope as follows:
<scopexpos='200'ypos='450'xend='200'yend='1500' ><callname='Enviar a Proceso NEGRIN'target='Radiologia.CConcertadosOrdenesNEGRIN'async='1'xpos='200'ypos='650' ><requesttype='Mensajes.Request.Radiologia.CConcertados.BusquedaOrdenesNEGRINRequest' ><assignproperty="callrequest"value="request"action="set" /></request><responsetype='Mensajes.Response.CConcertadostoPACS.Radiologia.BusquedaOrdenesNEGRINResponse' ><assignproperty="context.busquedaOrdenesNEGRINResponse"value="callresponse"action="set" /></response></call><callname='Enviar a Proceso HUNSC'target='Radiologia.CConcertadosOrdenesHUNSC'async='1'xpos='200'ypos='850' ><requesttype='Mensajes.Request.Radiologia.CConcertados.BusquedaOrdenesRequest' ><assignproperty="callrequest"value="request"action="set" /></request><responsetype='Mensajes.Response.Radiologia.CConcertados.BusquedaOrdenesResponse' ><assignproperty="context.listaBusquedaOrdenes.PacientesDerivadosCC"value="callresponse"action="insert"key="1" /></response></call><callname='Enviar a Proceso CHUIMI 02'target='Radiologia.CConcertadosOrdenesCHUIMI'async='1'xpos='200'ypos='1050' ><requesttype='Mensajes.Request.Radiologia.CConcertados.BusquedaOrdenesRequest' ><assignproperty="callrequest"value="request"action="set" /></request><responsetype='Mensajes.Response.Radiologia.CConcertados.BusquedaOrdenesResponse' ><assignproperty="context.listaBusquedaOrdenes.PacientesDerivadosCC"value="callresponse"action="insert"key="2" /></response></call><callname='Enviar a Proceso Fuertev'target='Radiologia.CConcertadosOrdenesFUERTEV'async='1'xpos='200'ypos='1150' ><requesttype='Mensajes.Request.Radiologia.CConcertados.BusquedaOrdenesRequest' ><assignproperty="callrequest"value="request"action="set" /></request><responsetype='Mensajes.Response.Radiologia.CConcertados.BusquedaOrdenesResponse' ><assignproperty="context.listaBusquedaOrdenes.PacientesDerivadosCC"value="callresponse"action="insert"key="2" /></response></call><syncname='Esperar respuestas'calls='Enviar a Proceso NEGRIN,Enviar a Proceso HUNSC,Enviar a Proceso CHUIMI 02,Enviar a Proceso Fuertev'timeout='"PT30S"'type='all'xpos='200'ypos='1250' /><faulthandlers><catchallxpos='200'ypos='1350'xend='200'yend='250' /></faulthandlers></scope>However, when we test it, we observe the following Visual Trace:
.png)
The BPL should wait to receive [12], [15], [17] and [19] before continuing executing the code below the <sync>... but it does not wait for the 4 replies... it just wait for one of them..png)
The <sync> is configured to wait for all the fours <call>
"Enviar a Proceso NEGRIN,Enviar a Proceso HUNSC,Enviar a Proceso CHUIMI 02,Enviar a Proceso Fuertev"
.png)
But it does not wait for all them.
Why?
How could we solve it?
Thanks for your help and time.
Thank you for your answer @Luis Angel Pérez Ramos
However, as I detailed in the first post the <sync> command does not do what it is supposed that it does.
We have used it as follows:
<sync name='Esperar respuestas' calls='Enviar a Proceso NEGRIN,Enviar a Proceso HUNSC,Enviar a Proceso CHUIMI 02,Enviar a Proceso Fuertev' timeout='"PT30S"' type='all' xpos='200' ypos='2550' />
.png)
But it does not stop the BPL execution until all the 4 calls finish with a repsonse... it just waits until the first call gives a response, and then it continues.
Could you help us, please?
Thank you.
Congratulations :=) 😀
@Eric Mariasis
It looks quite interesting, I have seen your youtube demonstration and it looks cool.
Thank you for sharing your work, and thanks for explaining it and thanks for your effort ✅
Thanks @Ashok Kumar T
It worked as you said perfectly fine.
Thanks for your help, and thanks for your kind and detailed explanation Ashok Kumar :=)
There are multiple line feeds and carriage returns not only one at start and at end
There are multiple line feeds and carriage returns not only one at start and at end
Thank you @Nicholai Mitchko
It is very interesting
Thanks, @Enrico Parisi , for your reply and help. It really helped us your explanation and logic. Thank you for your time and help with this topic Enrico Parisi.
Thank you @Suman Samanta
Your reply helped me and my team a lot.
Thanks for your answers, and thanks for your help.
Hello Enrico Parisi, @Enrico Parisi, thanks for your questions and thanks for your reply, sincerely.
The required logic is to merge the "resource" objects within the "entry" arrays, focusing solely on the "resource" objects. The process should not merge the entire entries themselves but rather extract and combine the "resource" objects from each entry.
Here's a brief summary of the logic:
- Extract the "resource" objects from each "entry" in response1 and response2.
- Combine these "resource" objects into a single array.
- Ensure the merged JSON contains only the combined "resource" objects, maintaining the integrity and structure of each "resource".
Please let me know if further clarification is needed.
Thanks Enrico Parisi for your time, reply and help.
The purpose or goal could be to use and show how to use Unit Tests in ObjectScript, and/or to employ best practices like making the code understandable and well commented. Vitaliy Serdtsev.
Thanks for your reply, Julius.
I understand your concern and would like to clarify the point of single digit numbers in this context.
The definition we have given is: “A number is Aesthetic if, in any base from base 2 to base 10, the absolute difference between each pair of adjacent digits is consistently equal to 1.” Now, when we talk about single digit numbers, they technically have no adjacent digits to compare, which may seem confusing.
However, in this context, we consider a single-digit number to be trivially aesthetic because there are no pairs of digits that can contradict the condition that the absolute difference is 1. In other words, there is no comparison to make that could invalidate the aesthetics of the number.
It is as if we were to say that a straight line is “smooth” because it has no curves that could make it rough. Similarly, a single digit is aesthetic because there are no differences between digits that would break the aesthetics.
In the case of the number 1, no matter what base you represent it in, it will always be a single digit. Therefore, there is no pair of adjacent digits to compare, and for this reason, it is considered to trivially meet the condition of being aesthetic.
I hope this clears up the doubt and justifies why a single digit number is considered aesthetic in any basis.
🙂🤔💭🟢 Thank you Julius for your deep reply and interesting observations, honestly they are totally right.
Greetings.
Hello everyone,
I appreciate your responses and perspectives on the challenge I posted. It's important to clarify that my intention was simply to share a programming challenge out of curiosity, and the context or the scenario of the programming challenge was created by another user. It's not a reflection of personal beliefs or values, but rather an abstract context in which this programming challenge was formulated.
Robert, I completely understand your viewpoint, and I respect your perspective based on your experiences. Marriage is indeed a deeply personal matter, and financial considerations may vary greatly from person to person.
Ba, thank you for sharing your experience. It's wonderful that your parents were able to support you during your wedding, and it's a testament to the importance of family support during such significant life events.
Luc, your perspective adds an interesting angle to the discussion. Indeed, the decision to allocate resources, whether for a wedding or other purposes, is deeply intertwined with individual priorities and values.
Once again, thank you all for engaging in the conversation, and I hope we can continue to share insights and perspectives in a respectful manner.
To be sincere and to be honest I did only posted it because I was curious about how could you solve it using ObjectScript. ✅✅✅🟩🟩🟩✅✅✅
Sorry if the context is not the best one.
Thanks @José Pereira, @Henry Pereira Pereira, @Henrique Dias Dias for your effort. Thanks for sharing your knowledge. Thank you!.
Thanks Iryna Mykhailova for explaining your project, thanks!
Thanks for your help, it was what we needed, @Victoria Castillo
Thank you once again for taking the time to share your expertise. It has provided us (my team and I) with a clearer direction moving forward.
Thanks Kurro! Because it looks like an outstanding effort, time, and dedication explaining IRIS to Teams integration, sincerely. Thank you.
Thank you Maria Nesterenko, because your explanation is quite invaluable, profound, vivid, and above all, inspiring and instructive. I deeply appreciate it.
Thanks @Lucas.Cristofolinibecause it looks helpful.
However I do not know how is related the code which shows Gevorg, and the need to convert a XML string to a Ensemble Class.
Thanks for your time and help @Lucas.Cristofolini.
We have tried to solve this issue ourselves as follows:
We have changed the method's output parameter, from an Ens.Response to an %XML.String(MAXLEN=""):
Before:
Method ProcesarPeticion(MSH As hl7.MSH.CONTENT, NTE As hl7.NTE.CONTENT, ORMO01PATIENT As hl7.ORMO01.PATIENT.CONTENT(XMLNAME="ORM_O01.PATIENT"), ORMO01ORDER As hl7.ORMO01.ORDER.CONTENT(XMLNAME="ORM_O01.ORDER"), SFT As hl7.SFT.CONTENT, MSA As hl7.MSA.CONTENT, ERR As hl7.ERR.CONTENT) As Mensajes.Response.Peticiones.Derivaciones.EnvioPeticiones.operacionResponse [ Final, ProcedureBlock = 1, SoapAction = "http://FUERTEVENTURA.Servicios/Asentimientos/ProcesarACK", SoapBindingStyle = document, SoapBodyUse = literal, SoapMessageName = ACK, SoapRequestMessage = ORM_O01, WebMethod ]
After:
Method ProcesarPeticion(MSH As hl7.MSH.CONTENT, NTE As hl7.NTE.CONTENT, ORMO01PATIENT As hl7.ORMO01.PATIENT.CONTENT(XMLNAME="ORM_O01.PATIENT"), ORMO01ORDER As hl7.ORMO01.ORDER.CONTENT(XMLNAME="ORM_O01.ORDER"), SFT As hl7.SFT.CONTENT, MSA As hl7.MSA.CONTENT, ERR As hl7.ERR.CONTENT) As %XML.String(MAXLEN="") [ Final, ProcedureBlock = 1, SoapAction = "http://FUERTEVENTURA.Servicios/Asentimientos/ProcesarACK", SoapBindingStyle = document, SoapBodyUse = literal, SoapMessageName = ACK, SoapRequestMessage = ORM_O01, WebMethod ]
In addition we have converted the Ens.Response Message to XML with the following code:
;30/01/2024 convertir a XML para quitar las etiquetas SOAP sobrantes:
set writer=##class(%XML.Writer).%New()
set status=writer.OutputToString()
If $$$ISERR(status)Do $system.OBJ.DisplayError(status)
set status=writer.RootObject(response)
If $$$ISERR(status) Do $system.OBJ.DisplayError(status)set pResponse = writer.GetXMLString()
$$$LOGALERT("pResponse: "_pResponse);set inicioCabeceras = "<?xml version=""1.0"" encoding=""UTF-8""?><ACK xmlns=""urn:hl7-org:v2xml"">"
;$$$LOGINFO("inicioCabeceras: "_inicioCabeceras)
set sinInicio = $PIECE(pResponse,"<operacionResponse>",2)
$$$LOGINFO("sinInicio: "_sinInicio)
set sinInicioFinal = $PIECE(sinInicio,"</operacionResponse>",1)
$$$LOGINFO("sinInicioFinal: "_sinInicioFinal)
set finalCabeceras = "</ACK>"
$$$LOGINFO("finalCabeceras: "_finalCabeceras)
;set mensajeACKcompleto = inicioCabeceras_sinInicioFinal_finalCabeceras
set mensajeACKcompleto = sinInicioFinal
$$$LOGINFO("mensajeACKcompleto: "_mensajeACKcompleto);quit response
quit mensajeACKcompleto
Being the Service's full code as we show:
Class Servicios.Peticiones.Derivaciones.Gestionv01r00 Extends EnsLib.SOAP.Service [ ClassType = "", Inheritance = right, ProcedureBlock ]
{
Parameter ADAPTER = "EnsLib.SOAP.InboundAdapter";/// Nombre del WebService.Parameter SERVICENAME = "Gestion";/// Namespace SOAP para el Servicio WebParameter NAMESPACE = "urn:hl7-org:v2xml";/// Se utilizarán namespaces de clases referenciadas en WSDL.Parameter USECLASSNAMESPACES = 1;
Method ProcesarPeticion(MSH As hl7.MSH.CONTENT, NTE As hl7.NTE.CONTENT, ORMO01PATIENT As hl7.ORMO01.PATIENT.CONTENT(XMLNAME="ORM_O01.PATIENT"), ORMO01ORDER As hl7.ORMO01.ORDER.CONTENT(XMLNAME="ORM_O01.ORDER"), SFT As hl7.SFT.CONTENT, MSA As hl7.MSA.CONTENT, ERR As hl7.ERR.CONTENT) As%XML.String(MAXLEN="") [ Final, ProcedureBlock = 1, SoapAction = "http://FUERTEVENTURA.Servicios/Asentimientos/ProcesarACK", SoapBindingStyle = document, SoapBodyUse = literal, SoapMessageName = ACK, SoapRequestMessage = ORM_O01, WebMethod ]
{
set request = ##class(Mensajes.Request.Peticiones.Derivaciones.EnvioPeticiones.operacionRequest).%New()
set request.MSH = MSH
do request.NTE.Insert(NTE)
set request.ORMO01PATIENT = ORMO01PATIENT
do request.ORMO01ORDER.Insert(ORMO01ORDER)
set tSC = ..SendRequestSync("EnrutadorGestionDerivaciones",request,.response)
;30/01/2024 convertir a XML para quitar las etiquetas SOAP sobrantes:set writer=##class(%XML.Writer).%New()
set status=writer.OutputToString()
If$$$ISERR(status)
Do$system.OBJ.DisplayError(status)
set status=writer.RootObject(response)
If$$$ISERR(status) Do$system.OBJ.DisplayError(status)
set pResponse = writer.GetXMLString()
$$$LOGALERT("pResponse: "_pResponse)
;set inicioCabeceras = "<?xml version=""1.0"" encoding=""UTF-8""?><ACK xmlns=""urn:hl7-org:v2xml"">";$$$LOGINFO("inicioCabeceras: "_inicioCabeceras)set sinInicio = $PIECE(pResponse,"<operacionResponse>",2)
$$$LOGINFO("sinInicio: "_sinInicio)
set sinInicioFinal = $PIECE(sinInicio,"</operacionResponse>",1)
$$$LOGINFO("sinInicioFinal: "_sinInicioFinal)
set finalCabeceras = "</ACK>"$$$LOGINFO("finalCabeceras: "_finalCabeceras)
;set mensajeACKcompleto = inicioCabeceras_sinInicioFinal_finalCabecerasset mensajeACKcompleto = sinInicioFinal
$$$LOGINFO("mensajeACKcompleto: "_mensajeACKcompleto)
;quit responsequit mensajeACKcompleto
}
Method OnProcessInput(pInput As EnsLib.HL7.Message) As%Status
{
Quit..SendRequestAsync("EnrutadorGestionDerivaciones",pInput)
}
}
When we execute it, the $$$LOGINFO("mensajeACKcompleto: "_mensajeACKcompleto) does outputs the desired output:
<MSHxmlns:s01="urn:hl7-org:v2xml"><s01:MSH.1>|</s01:MSH.1><s01:MSH.2>
<![CDATA[^~\&]]>
</s01:MSH.2><s01:MSH.3><s01:HD.1>sistemaExterno</s01:HD.1></s01:MSH.3><s01:MSH.4><s01:HD.1>scs</s01:HD.1><s01:HD.2>350290</s01:HD.2></s01:MSH.4><s01:MSH.5><s01:HD.1>HGF</s01:HD.1></s01:MSH.5><s01:MSH.6><s01:HD.1>EXTHL7</s01:HD.1></s01:MSH.6><s01:MSH.7><s01:TS.1>20240130110908</s01:TS.1></s01:MSH.7><s01:MSH.9><s01:MSG.1>ACK</s01:MSG.1></s01:MSH.9><s01:MSH.10>70589905</s01:MSH.10><s01:MSH.11><s01:PT.1>P</s01:PT.1></s01:MSH.11><s01:MSH.12><s01:VID.1>2.5</s01:VID.1></s01:MSH.12><s01:MSH.13>1</s01:MSH.13><s01:MSH.15>AL</s01:MSH.15><s01:MSH.16>AL</s01:MSH.16><s01:MSH.18>ASCII</s01:MSH.18></MSH><MSAxmlns:s01="urn:hl7-org:v2xml"><s01:MSA.1>AA</s01:MSA.1></MSA>However, when we see the response being replied by the SOAP Service to the SoapUI it shows the extra XML tag "<ProcesarPeticionResult>":
<SOAP-ENV:Envelopexmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:s="http://www.w3.org/2001/XMLSchema"><SOAP-ENV:Body><ACKxmlns="urn:hl7-org:v2xml"><ProcesarPeticionResult><MSHxmlns:s01="urn:hl7-org:v2xml"><s01:MSH.1>|</s01:MSH.1><s01:MSH.2>^~\&</s01:MSH.2><s01:MSH.3><s01:HD.1>sistemaExterno</s01:HD.1></s01:MSH.3><s01:MSH.4><s01:HD.1>scs</s01:HD.1><s01:HD.2>350290</s01:HD.2></s01:MSH.4><s01:MSH.5><s01:HD.1>HGF</s01:HD.1></s01:MSH.5><s01:MSH.6><s01:HD.1>EXTHL7</s01:HD.1></s01:MSH.6><s01:MSH.7><s01:TS.1>20240130110908</s01:TS.1></s01:MSH.7><s01:MSH.9><s01:MSG.1>ACK</s01:MSG.1></s01:MSH.9><s01:MSH.10>70589905</s01:MSH.10><s01:MSH.11><s01:PT.1>P</s01:PT.1></s01:MSH.11><s01:MSH.12><s01:VID.1>2.5</s01:VID.1></s01:MSH.12><s01:MSH.13>1</s01:MSH.13><s01:MSH.15>AL</s01:MSH.15><s01:MSH.16>AL</s01:MSH.16><s01:MSH.18>ASCII</s01:MSH.18></MSH><MSAxmlns:s01="urn:hl7-org:v2xml"><s01:MSA.1>AA</s01:MSA.1></MSA></ProcesarPeticionResult></ACK></SOAP-ENV:Body></SOAP-ENV:Envelope>How could we achieve to remove the undesired "<ProcesarPeticionResult>" XML tag?
Thanks for your time.
Thanks for your help.
Thanks for your replies.
.png)
.png)
Could you please, help us? By pointing some documentation or linking to some example to address this need?
Thanks for your answers.
Thanks for your help, time and explanations @Alexander Koblov
Thank you.
This discovery did not occur in 2023, it is older; however, I find it truly astonishing:
Elena García Armada, a Spanish industrial engineer, leads the CSIC team that has developed the world's first bionic exoskeleton for children with spinal muscular atrophy, a degenerative disease affecting around 2,000 minors in Spain.

Thanks @Shanshan Yu it worked as expected.
We have changed both ESBSSCC's and ESBCHUIMI's NAMESPACE to be: http://SIPRESatelites/SIPRESatelites.wsdl
So then ESBSSCC's SOAP Header class is:
Class EsquemasDatos.ProgramasAsistenciales.DragoAE.tns.CredencialesType Extends (%Persistent, %SOAP.Header) [ ProcedureBlock ]
{
Parameter ELEMENTQUALIFIED = 1;Parameter NAMESPACE = "http://SIPRESatelites/SIPRESatelites.wsdl";// Parameter NAMESPACE = "http://SCS.Servicios/ProgramasAsistenciales";Parameter XMLFORMAT = "literal";Parameter XMLNAME = "Credenciales";Parameter XMLSEQUENCE = 1;Property usuario As%String(MAXLEN = "", XMLNAME = "usuario") [ Required ];Property password As%String(MAXLEN = "", XMLNAME = "password") [ Required ];And then, ESBCHUIMI's SOAP Header class as the same NAMESPACE:
Class EsquemasDatos.ProgramasAsistenciales.DragoAE.tns.CredencialesType Extends (%Persistent, %SOAP.Header) [ ProcedureBlock ]
{
Parameter ELEMENTQUALIFIED = 1;Parameter NAMESPACE = "http://SIPRESatelites/SIPRESatelites.wsdl";// Parameter NAMESPACE = "http://SCS.Servicios/SIPRESatelites";Parameter XMLNAME = "CredencialesType";Parameter XMLSEQUENCE = 1;Property usuario As%String(MAXLEN = "", XMLNAME = "usuario") [ Required ];Property password As%String(MAXLEN = "", XMLNAME = "password") [ Required ];To sum up, the solution was to writte the same NAMESPACE at both ESBSSCC's and ESBCHUIMI's SOAP Header classes:
Parameter NAMESPACE = "http://SIPRESatelites/SIPRESatelites.wsdl";
Again, thanks @Shanshan Yu for your help, time, and examples.
Thanks @Shanshan Yu for your help.
Yes it does, the ESBCHUIMI's web service client class has it code to handle the SOAP header as follows:
Method actualizarEstadoSolicitudOrto(idsolicitud As%String(XMLNAME="id_solicitud",REQUIRED=1), codcentroentidad As%String(XMLNAME="cod_centro_entidad",REQUIRED=1), numexpedientetarjeta As%String(XMLNAME="num_expediente_tarjeta",REQUIRED=1), estado As%String(XMLPATTERN="\d{1,100}",REQUIRED=1), observaciones As%String(MAXLEN=4000), Output descripcion As%String(REQUIRED=1), usuario As%String(REQUIRED=1), password As%String(REQUIRED=1)) As%Numeric(XMLNAME="codigo") [ Final, ProcedureBlock = 1, SoapBindingStyle = document, SoapBodyUse = literal, WebMethod ]
{
//credenciales en el headerset Credenciales = ##class(EsquemasDatos.ProgramasAsistenciales.DragoAE.tns.CredencialesType).%New()
set Credenciales.usuario = usuario
set Credenciales.password = password
do..HeadersOut.SetAt(Credenciales, "Credenciales")
Quit..WebMethod("actualizarEstadoSolicitudOrto","ActualizarEstadoSolicitudOrtoRequestElement").Invoke($this,"http://SIPRESatelites/SIPRESatelites.wsdl/actualizarEstadoSolicitudOrto",.idsolicitud,.codcentroentidad,.numexpedientetarjeta,.estado,.observaciones,.descripcion)
}
The challenge is that there is an Exception between what ESBSSCC's web service client outputs and what ESBCHUIMI's SERVICE class handles as inputs, because it fails at recognizing SOAP Header's Credenciales, and the execution flow breaks at line 7 at ESBCHUIMI's Service Class code here:
set request.usuario = ..HeadersIn.GetNext().usuario
We have also tried to call it as follows and it stills failling:
set request.usuario = ..HeadersIn.GetNext("Credenciales").usuario
Being the Error code as follows:
| Id.: | 320758306 |
| Tipo: | Error |
| Texto: | ERROR #6248: La respuesta de SOAP es un error de SOAP: faultcode=Server faultstring=Error del servidor de aplicaciones. faultactor= detail= <error xmlns="http://SCS.Servicios/SIPRESatelites"> <text>ERROR #5002: Error de cache: <INVALID OREF>zactualizarEstadoSolicitudOrto+7^Servicios.ProgramasAsistenciales.DragoAE.Ortoprotesis.SIPREtoDragoAEv01r00.1</text> </error> |
.png)
Could you help us please?
Thanks for your time.
Thanks for your help.
Thanks for your replies.
Thanks @Anna Diak
for explaining and sharing your work.