Scott Beeson · Oct 11, 2016 go to post

I'll take a look at those docs, but I really like having direct access to my data so I can use it however I need (for instance in my custom dashboard, in a weekly report, manipulate it in Excel, etc, etc).  I don't want my data to be trapped in Zen or require Cache code to retrieve.

I actually have a SQL query that will give the average response time of a request for a given date range and message type:

SELECT Name, AVG(ResponseTime) as AvgResponse FROM (
SELECT
        li.SessionId,
        li.name,
        datediff(ms,min(li.TimeCreated),max(lo.TimeCreated)) as ResponseTime
FROM
    (Select h1.SessionId, TimeCreated, SAMLData_Organization, m1.name FROM ens.messageheader h1,HS_Message.XMLMessage m1 WHERE h1.MessageBodyId = m1.id) li
    LEFT JOIN (Select h2.SessionId, TimeCreated FROM ens.messageheader h2,HS_Message.XMLMessage m2 WHERE h2.MessageBodyId = m2.id) lo
    ON li.SessionId = lo.SessionId
WHERE li.TimeCreated >= '2016-10-01' AND li.TimeCreated < '2016-10-02'
AND Name = 'XDSB_QUERYREQUEST'
GROUP BY li.SessionId
) GROUP BY Name
Scott Beeson · Oct 11, 2016 go to post

After rereading this I'm even more confused.  You are saying that you shouldn't query the data directly because those tables might not "stay the same"?

Scott Beeson · Oct 11, 2016 go to post

I didn't know he had "Information Exchange".  Are you sure he does?

I've always been told performance was the reason for using my query environment and now you're saying it's because the data might be different or out of date??

Also, I couldn't find the APIs you mentioned, can I get a link?  Are these available in Healthshare or just this new "Information Exchange" sub-product?

Scott Beeson · Oct 10, 2016 go to post

Everything except system metrics.  

Searches by Customer
Documents in Storage
Average Query Response Times
Number of ADTs
etc.

Scott Beeson · Oct 10, 2016 go to post

Thanks for the info!  I found the statement, I believe, but I'm having trouble understanding.

Quit $Case(pDT, "DT":$S(pVal?1(4N,6N,8N)&&($E(pVal,1,4)>1700)&&($E(pVal,1,4)<2200)&&(""=$E(pVal,5,6)||($E(pVal,5,6)>0&&($E(pVal,5,6)<=12)))&&(""=$E(pVal,7,8)||($E(pVal,7,8)>0&&($E(pVal,7,8)<=$Case($E(pVal,5,6),2:29,4:30,6:30,9:30,11:30,:31)))):$$$OK, 1:$$$ERROR($$$EnsErrGeneral,"Invalid date value '"_pVal_"' found for type '"_pDT_"' in segment "_$S($get(info("SegNum"))'="":info("SegNum")_":",1:"")_info("SegName")_", field "_info("fieldNum")_", repetition "_info("rep")_", component "_info("comp")_", subcomponent "_info("subComp")_".")), "DTM":$S(pVal?1(4N,6N,8N,10N,12N,14N,14N1".".4N)&&(tZ?.1(1(1"+",1"-")4N))&&($E(pVal,1,4)>1700)&&($E(pVal,1,4)<2200)&&(""=$E(pVal,5,6)||($E(pVal,5,6)>0&&($E(pVal,5,6)<=12)))&&(""=$E(pVal,7,8)||($E(pVal,7,8)>0&&($E(pVal,7,8)<=$Case($E(pVal,5,6),2:29,4:30,6:30,9:30,11:30,:31))))&&(""=$E(pVal,9,10)||($E(pVal,9,10)>=0&&($E(pVal,9,10)<24)))&&(""=$E(pVal,11,12)||($E(pVal,11,12)>=0&&($E(pVal,11,12)<60)))&&(""=$E(pVal,13,14)||($E(pVal,13,14)>=0&&($E(pVal,13,14)<60))):$$$OK, 1:$$$ERROR($$$EnsErrGeneral,"Invalid date/time value '"_pVal_"' found for type '"_pDT_"' in segment "_$S($get(info("SegNum"))'="":info("SegNum")_":",1:"")_info("SegName")_", field "_info("fieldNum")_", repetition "_info("rep")_", component "_info("comp")_", subcomponent "_info("subComp")_"."))

It looks like both `DT` and `DTM` require a format similar to "20161010" but what is up with the $Case($E(pVal,5,6),2:29,4:30,6:30,9:30,11:30,:31), this makes no sense to me. And why is it part of "DT" which seems to be date without time?

Scott Beeson · Oct 10, 2016 go to post

Great answer.  I work at an HIE, how come I've never heard of most of the "products"?  Besides Patient Index, all these other things are new to me.  Where can I find more info on the "Information Exchange" product?  Can you purchase/implement these items separately or are they dependent upon each other?  Where does the Clinical Viewer fit into this?  How is Health Insight different that DeepSee?

Scott Beeson · Oct 10, 2016 go to post

Try this:

SELECT  * FROM HS_SDA3_Streamlet.Encounter WHERE SourceMRN = '12345'

(Replace 12345 with the MRN of the patient you want to list the records of)

But as Robert mentioned, Intersystems does not recommend querying the tables directly. Do you know if you have a separate query environment set up by using the healthshare Mirror funtionality?

The reason they don't recommend querying the live data directly is due to potential performance impact.  But ultimately, that decision is up to you.  

Scott Beeson · Oct 10, 2016 go to post

This is all well and good but the whole point in a community like this is so that people don't have to call and subsequent users with similar questions have access to the information.  I'm especially interested in the solution here.

Scott Beeson · Oct 7, 2016 go to post

This explains it. And I'd heard this before, I guess it just really doesn't make sense to me.  Sometimes it seems arbitrary which queries are fast and which are not.

Scott Beeson · Oct 7, 2016 go to post

Thanks for the info. Since we're hosted by Intersystems I assume all that was taken into account :)

I just want my data. :)

Scott Beeson · Aug 25, 2016 go to post

I actually have it set to e-x which should include data type validation, right?

My question really is, how does that "DT" definition define a date? There's no regex or anything.  How does it know if it should be YYYYMMDD HHMMSS or mm/dd/yy hh:mm:ss?

<DataType name='DT' description='Date (2.8.13)'> <DataSubType piece='1' description='Date (2.8.13)'/> </DataType> doesn't really mean anything... does it?

Scott Beeson · Aug 22, 2016 go to post

And just to provide some context to what I'm trying to accomplish, we have had numerous instances in the past where a customer started sending data we did not expect.  In some cases, these changes technically met the schema and in other cases it violated it but we never had our productions set up to alert on validation exceptions.  As a result of a few of these, I am currently doing a complete ADT remediation process where I am tightening the schemas and enabling alerting for  validations on all namespaces.

Is this not recommended? Do you have other input or advice?

Scott Beeson · Aug 18, 2016 go to post

I'm stupid, I hadn't even tried the examples I used above.  <!-- comment --> seems to work fine!

Scott Beeson · Aug 5, 2016 go to post

Thanks.  How would I initiate a request to have the documentation updated?

Scott Beeson · Jul 13, 2016 go to post

My understanding is that this sends the message in question to the handler instead of the normal process.  I do not want this.  Currently I am working on a solution that I think will work and I will update here when I know more.

Scott Beeson · Jul 7, 2016 go to post

Yes, this is a great idea and is typical of support communities.  It's very useful for a user to know of the person who is answering is staff or just someone from the community. 

Scott Beeson · Jul 7, 2016 go to post

The emails still need a lot of work, but it's better than the wall of plain text we were getting!

As for the thumbs up, I would think ratings of 1 should have been a thumbs down, but no big deal.

Overall, great work! Happy to finally have thumbs up/down!

Scott Beeson · Jun 22, 2016 go to post

Illegal CSP Request : CSP Error

21 instances of that, which sounds about right with me poking around trying to fix it.

Not sure that's more helpful :\

Ideas?