go to post Murillo Braga · Feb 2, 2017 Hello mate,It generates the same error: ERROR #6301: SAX XML Parser Error: invalid character 0x18 while processing Anonymous Stream at line 1 offset 4183Here is the code: d msg.Value.Rewind() set fs=##class(%Stream.FileCharacter).%New()set fs.Filename="D:\DATABASES\OVPATH\temp\test0.xml"set fs.TranslateTable = "UTF8"set tSC=fs.CopyFrom(msg.Value)set tSC=fs.%Save()s reader=##class(%XML.Reader).%New()d fs.Rewind() // might not be necessary, but won't hurtSet sc = reader.OpenStream(fs)if $$$ISERR(sc){set fs=##class(%Stream.FileCharacter).%New()set fs.Filename="D:\DATABASES\OVPATH\temp\errorOpen0.xml"do fs.Write($$$StatusDisplayString(sc))set tSC=fs.%Save()}
go to post Murillo Braga · Feb 1, 2017 John,Just to let you know, I am still a beginner with ObjectScript/Cache/Healthsare, so please excuseany primary mistakes you may encounter :)Can you kindly help me out to write this piece of code you advised? (P.S: msg.Value is the stream) set fs=##class(%Library.GlobalCharacterStream).%New()set fs.TranslateTable = "UTF8"set tSC=fs.CopyFromAndSave(msg.Value) s sc= xread.OpenStream(???)if $$$ISERR(sc){...}---I came up with that a few moments ago: (at this point I have the stream available (msg.Value) and I will handle it in 2 different ways: by writing is a file and trying to open it (OpenFile) and by reading it (OpenStream)) // // 1st approach - it succeeds, so the file errorOpenFile.xml is NOT generated // d msg.Value.Rewind() set fs=##class(%Stream.FileCharacter).%New() set fs.Filename="D:\DATABASES\OVPATH\temp\test.xml" set fs.TranslateTable = "UTF8" set tSC=fs.CopyFrom(msg.Value) set tSC=fs.%Save() s reader=##class(%XML.Reader).%New() Set sc = reader.OpenFile("temp/test.xml") if $$$ISERR(sc) { set fs=##class(%Stream.FileCharacter).%New() set fs.Filename="D:\DATABASES\OVPATH\temp\errorOpenFile.xml" do fs.Write($$$StatusDisplayString(as)) set tSC=fs.%Save() } // // 2nd approach - it fails, so I have the file errorOpenStream.xml generated // Set xread = ##class(%XML.Reader).%New() Set xread.IgnoreNull=1 d msg.Value.Rewind() s sc= xread.OpenStream(msg.Value) if $$$ISERR(sc) { set fs=##class(%Stream.FileCharacter).%New() set fs.Filename="D:\DATABASES\OVPATH\temp\errorOpenStream.xml" do fs.Write($$$StatusDisplayString(sc)) set tSC=fs.%Save() }
go to post Murillo Braga · Jan 31, 2017 My 1st message on this post shows the piece of code where the pInput is originally fed.And as I told there, I write the output content to a file and once I open this file, the contents are shown properly and the character is there, intact.
go to post Murillo Braga · Jan 31, 2017 Hello John,Thanks again for your help!There you go the outcome:1st one:<?xml version="1.0" encoding="UTF-8" ?>< ... (more content)2nd one:6063120I'm not sure about the BOM, but the XML returned does state the UTF-8 encoding.
go to post Murillo Braga · Jan 30, 2017 Hello mate,Thanks for you quick response. Actually there was no specific reason for using the FileBinary, so I managed to change it to FileCharacter and used also the property "TranslateTable = "UTF8", which hence allowed the file to be written with the special character I wanted.By discovering that, I came back to the 1st place I originally thought the issue would be and now I guess that it's the right place to look at: Method OnProcessInput(pInput As %Stream, Output pOutput As %RegisteredObject, ByRef pHint As %String) As %Status{ // Create an instance of %XML.Reader Set xread = ##class(%XML.Reader).%New() Set xread.IgnoreNull=1 // Begin processing of the file d pInput.Rewind() s sc= xread.OpenStream(pInput) if $$$ISERR(sc){set fs=##class(%Stream.FileCharacter).%New()set fs.Filename="c:\TEMP\OnProcessInput00.xml"set fs.TranslateTable = "UTF8"do fs.Write($$$StatusDisplayString(sc))set tSC=fs.%Save()} ---Here I had the file created and the error message written in it (ERROR #6301: SAX XML Parser Error: invalid character 0x18 while processing Anonymous Stream at line 1 offset 4627).So I presume thats sc= xread.OpenStream(pInput)Is erroring, because the stream contains a special character.What do you think?Thanks
go to post Murillo Braga · Jan 26, 2017 Hey John, thanks for you response!I wrote some debug piece of code to write into a xml file the pInput content and that's what I get: <?xml version="1.0" encoding="UTF-8" ?> ... <Value><![CDATA[ ... <P>SORRY TO SAY THAT THIS CHARACTER WILL MESS THIS UP ?</P> ... ]]></Value>Where you see the question mark, it is indeed the place the weird character is supposed to be.By opening the file with Notepad++ and checking the 'Encoding' menu, it shows 'Encode with UTF-8 without BOM'.Any clues?Thanks
go to post Murillo Braga · Jun 24, 2016 My team leader advised me to do one thing that did the trick: stop the production, save the business rule and then restart the production and resend the message again.He said it sounds like it's something related to memory management done by the Ensemble, because for safety reasons/keep the messages flowing correctly, it keeps some previous compiled version in memory until a certain point and then brings new one as soon as it realizes that either it's the right time to do it or I've ordered it to do so. I might be saying bullshit, but as I've said, I'm just a begginer in this environment.Thanks mates!
go to post Murillo Braga · Jun 24, 2016 My team leader advised me to do one thing that did the trick: stop the production, save the business rule and then restart the production and resend the message again.He said it sounds like it's something related to memory management done by the Ensemble, because for safety reasons/keep the messages flowing correctly, it keeps some previous compiled version in memory until a certain point and then brings new one as soon as it realizes that either it's the right time to do it or I've ordered it to do so. I might be saying bullshit, but as I've said, I'm just a begginer in this environment.Thanks mates!
go to post Murillo Braga · Jun 24, 2016 My team leader advised me to do one thing that did the trick: stop the production, save the business rule and then restart the production and resend the message again.He said it sounds like it's something related to memory management done by the Ensemble, because for safety reasons/keep the messages flowing correctly, it keeps some previous compiled version in memory until a certain point and then brings new one as soon as it realizes that either it's the right time to do it or I've ordered it to do so. I might be saying bullshit, but as I've said, I'm just a begginer in this environment.Thanks mates!
go to post Murillo Braga · Jun 24, 2016 My team leader advised me to do one thing that did the trick: stop the production, save the business rule and then restart the production and resend the message again.He said it sounds like it's something related to memory management done by the Ensemble, because for safety reasons/keep the messages flowing correctly, it keeps some previous compiled version in memory until a certain point and then brings new one as soon as it realizes that either it's the right time to do it or I've ordered it to do so. I might be saying bullshit, but as I've said, I'm just a begginer in this environment.Thanks mates!
go to post Murillo Braga · Jun 21, 2016 Sorry for the wrong information, mate. I'm quite new on this and I'm using Healthshare (v. 2015.2 1HS. 7913.0).Can you tell me how to get to this INT level? Can you kindly provide a printscreen?Thank you!
go to post Murillo Braga · Jun 21, 2016 Hello mate,Thanks for the response. Actually I'm using Healthshare, sorry for the wrong information. I'm quite new on that.The idea about testing each of them individually does not work. It seems that any constraint that I add there, it blocks the operations below it. If I remove the constraint, it goes through well.Again, as I've said in my first comment, the rule that I have which has no constraints, works pretty fine.But the thing is I need to add this constraint in order to assess a few data from the HL7 ADT A01 message and that is the only way to do it, right?Healthshare version: 2015.2 1HS. 7913.0
go to post Murillo Braga · Jun 21, 2016 Hello Daniel,Thanks for you help , but it doesn't help me much. As I said, if I place a very basic rule there with (if 1=1 OR 1=2), it works fine, but as soon as I just place a constraint on the rule (which source is a hl7 file being sent by my business service 'Service for input file'), it blocks the message from being forwarded.Here is the rule:<ruleSet name="Rule set name =)" effectiveBegin="" effectiveEnd=""><rule name="" disabled="false"><constraint name="source" value="Service for input file"></constraint><constraint name="docCategory" value="2.2"></constraint><constraint name="docName" value="ADT_A01"></constraint><when condition="(1=2)||(1=1)"><send transform="" target="BO HL7"></send></when></rule>
go to post Murillo Braga · Jun 21, 2016 Actually if I add a rule with IF 1=1 OR IF 1=2, it goes through, but if I add a constraint on it, it won't work anymoreI'm grabbing a HL7 file from a folder. There is the message:MSH|^~\&|7edit||7edit||20160613154817||ADT^A01|MSG-20160613-154817-0669|P|2.2EVN|A01|20160613154837^20160613154844PID|5544||987||Braga^MurilloPV1|9877|C