Stored Query FindDocuments

Jul 8, 2009 at 4:06 PM
Edited Jul 8, 2009 at 4:16 PM

Hello,

I'm running into some issues when executing stored queries.  The queries complete however they are returning an empty list of reference objects.

Specifically, I am having issues with the FindDocuments stored query at the moment.

My message looks like this-

 

<query:AdhocQueryRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:query="urn:oasis:names:tc:ebxml-regrep:xsd:query:3.0" xmlns="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0" xmlns:rs="urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0">
<query:ResponseOption returnComposedObjects="true" returnType="LeafClass"/>
<AdhocQuery id="urn:uuid:14d4debf-8f97-4251-9a74-a90016b0af0d">
<Slot name="$XDSDocumentEntryStatus">
<ValueList>
<Value>('urn:oasis:names:tc:ebxml-regrep:StatusType:Approved')</Value>
</ValueList>
</Slot>
<Slot name="$XDSDocumentEntryPatientId">
<ValueList>
<Value>'498ef443e7ac4a6^^^&amp;1.3.6.1.4.1.21367.2005.3.7&amp;ISO'</Value>
</ValueList>
</Slot>
</AdhocQuery>
</query:AdhocQueryRequest>

 

After doing some tracing, I've found that the quotes are not right on the patientUID paramter... so the patientUID values in the stored procedure calls look like this-

 

exec usp_get_documentEntryDetails_DocumentEntry_Patient @availabilityStatus=N'urn:oasis:names:tc:ebxml-regrep:StatusType:Approved',@patientUID=N'''498ef443e7ac4a6^^^&1.3.6.1.4.1.21367.2005.3.7&ISO'''

 

As you can see, there are two extra single quotes on each side of the patientUID parameter. 

My first assumption would be that the AddInParameter method [I'm assuming this comes from Microsoft.Practices.EnterpriseLibrary...] is trying to escape the single quotes which is fine... but if this is the case then it seems to me that the application code should make sure that unnecessary message level quotes get stripped out prior to whenever values get stuffed in the object handling the stored procedure calls

I have tested with other types such as GetDocuments and the paramaters seem to be going through just fine... so I'm thinking this issue could be isolated to FindDocument because it looks like the GetDocuments parameters are getting handled slightly differently than the patientUID parameter within the usp_get_documentEntryDetails_DocumentEntry_Patient SP.

So at this point, it is not clear to me exactly how the enclosing quotes in patientUID paramter were intended to be handled so I'm not sure what needs to be fixed... BUT I suppose my main point here is- The quotes are not being hadled properly as far as I can tell and I have provided the message that I'm using to test, quadruple checked the IHE specs, etc and I'm unable to find any mistakes on my end as far as usage goes.

Let me know if I'm doing something wrong or if I should be submitting this as a bug.

Thanks,

Mat