Looking for implementation idea with display of webservice data
Hi all,
I am looking for an implementation idea for displaying a large amount of data received from a webservice. This data are essentialy HL7-Message as a GlobalCharacter Stream and some metadata (status,processed,timecreated etc.).
Since I need sorting functionalities for those metadata a tablepane in a zen page seems to be suitable. i know there are different ways to provide data for the table but in this case it´s complicated to get them data fetched.
Consider the following steps
1. Get the data from webservice
2. Temporary store the data, only in cache (in my case a lokal variable on the server in the zen page)
3. Process the data for the tablepane (format etc.) wich means makeup them data for the tablepane
4. Refresh the table/update view
My problem is, I have no idea on how to implement steps 2 - 4. My current approach is something like (in pseudo):
// In a zenpageProperty %MessageList As %ListOfObjects; // a method which fills in %MessageList For i=1:1:FetchedMessages.Count() { Do ..%MessageList.Insert(FetchedMessage.GetAt(i)) }
Now the triggering of the tablepane and data display comes into play.
Maybe someone has suggestions or a good idea to provide a solid solution on that display stuff. Any idea would be very appreciated.
best regards,
sebastian
Comments
Create a table with below properties
Class MessageStore Extends %Persistent
{
Property ReceivedTime as %TimeStamp;
Property MessageContent as %GlobalBinaryStream;
}
Now in your WebMethod create one object of a stream object.
Method GetHL7Message(Payload As %GlobalBinaryStream) As %Status[ WebMethod ]
{
set oStreamContent=##class( %GlobalBinaryStream).%New()
set tSC=oStreamContent.CopyFrom(Payload)
set oTable=##class(MessageStore).%New()
set oTable.MessageContent .CopyFrom(oStreamContent) /// Sometime directly copying does not work not sure why. Try this when exactly it can copy
set oTable.ReceivedTime=##class(%Library.UTC).NowLocal()
set tSC=oTable.%Save()
}
Now in your zen page show the content in a text area. using textArea.value=OStream.Read()
Let me know if you face any more problem with this.