Return ACK from Process
Hello,
We would need some help, please
First of all thanks for your time used reading this question
Also, thanks for your patience
We need to generate an ACK in a Process and return it to the Service to reply
We have currently written a code block with:
//Devolvemos ACK AA a DragoAP para indicar que no procesamos las prepeticiones
set pOutput = ##class(%GlobalCharacterStream).%New()
//set ACKer7 = ..GetAck(mensajeHL7, "AA")
set ACKer7 = ##class(ITB.HL7.BS.XMLService).GetAck(context.mensajeHL7, "AA")
set ACKxml = ##class(ITB.HL7.Util.Convert).ER7ToXML(ACKer7,.tSC)
set inicioCabecerasSOAP = "<SOAP-ENV:Envelope xmlns:SOAP-ENV=""http://schemas.xmlsoap.org/soap/envelope/""><SOAP-ENV:Header/><SOAP-ENV:Body>"
set finCabecerasSOAP = "</SOAP-ENV:Body></SOAP-ENV:Envelope>"
do pOutput.Write(inicioCabecerasSOAP_ACKxml.Read()_finCabecerasSOAP)
When we test this code, we observe:
ERROR <Ens>ErrException: <METHOD DOES NOT EXIST>zS5+6^Procesos.Laboratorio.EnrutadorLaboratorio.Thread1.1 *GetAck,ITB.HL7.BS.XMLService -- - registrado como '-' número - @' set ACKer7 = ##class(ITB.HL7.BS.XMLService).GetAck(context.mensajeHL7, "AA")' |
Why do we get this error message?
As you would notice we have written:
set ACKer7 = ##class(ITB.HL7.BS.XMLService).GetAck(context.mensajeHL7, "AA")
When we press F12 above ITB.HL7.BS.XMLService
We observe the desired GetAck method
How could we further debug, understand, and solve this issue?
➡️ We have read:
https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls...
https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls...
https://community.intersystems.com/post/reply-custom-ack
https://www.intersystems.com/wp-content/uploads/sites/10/WiFISEasyConnec...
➡️ Thanks for your replies
Please post the source code for ITB.HL7.BS.XMLService so we can take a look.
One thing to check: is GetAck declared as a "Method" or as a "ClassMethod"? If it is declared as a "Method" then that is the problem. The syntax you're using to call it is class method syntax, not instance method syntax.
Hello Marc Mundt,
ITB.HL7.BS.XMLService code is the following:
GetAck is a "Method"
How should we call it using method syntax, Marc Mundt?
Thanks for your replies
You need to instantiate that class as an object and then you can call methods on the object:
https://docs.intersystems.com/irisforhealthlatest/csp/docbook/Doc.View.c...
If you want to be able to call that method without first creating an instance of your class, you need to define the method as a Class Method, not just a Method. Add "Class" before Method on that function definition and recompile your class, and it will probably work.
Otherwise, like Marc said, you'll have to instantiate the class then call the method on that instance.