TUTORIAL
Intro to OpenGate
​
Introduction
​
OpenGate is a database access technology for real-time data retrieval from MEDITECH’s Expanse, Client/Server and MAGIC platforms. OpenGate uses a SQL style syntax to query MEDITECH data directly. All OpenGate queries have a common set of keywords that define the fields and conditions of the data being requested from the database.
​
​
Included with OpenGate are the following:
​
-
Query Analyzer -a development tool for designing and writing queries
-
SSRS add-on - query data directly into Reporting Services Reports – no staging of data in SQL
-
SQL CLR integration - allows data to be queried directly into Microsoft SQL Server
-
Web service - query MEDITECH data directly through a web service for your custom applications
-
Database driver - ADO.NET database driver that can be used with any .NET development project
​
Query Analyzer
​
Query Analyzer makes use of OpenGate and allows for the development of queries with its extremely helpful toolset. This includes a schema browser for searching through the MEDITECH schema and examining data relationships.
​
Schema Browser
​
The included schema browser lets you search through the MEDITECH schema to find fields and understand their relationships.
​
OpenGate Syntax
Select [NPR Element or M-AT Field]
​
From/Join [NPR Segment or M-AT Record]
​
Where [Condition on Element or Field]
​
​
SELECT
The SELECT clause defines the fields that will be returned in the query result.
​
FROM/JOIN
The FROM clause defines the indexes and records that OpenGate will use in order to gather the fields in the SELECT clause(s).
​
WHERE
The WHERE clause allows predicates to be added to the query so that records are only returned when they have certain properties
​
​
Select
MisPerson.IdX.Id,
MisPerson.IdX.IdType,
MisPerson.IdX.Active,
MisPerson.IdX.IsProvider
​​
FROM MisPerson.IdX
JOIN MisPerson.Main