Ocean Informatics EHR Service Interface
Introduction
The interface below is the current EHR service interface for the back end EhrBank component, within the Ocean Informatics openEHR-based EHR product.
StatusThis specification below is essentially complete, but some small details may be changed over time.
Design Concept
The service specified below is a coarse-grained, stateless service interface to an openEHR data store. EHRs are committed in Contributions, and accessed either as individual Compositions or via AQL Queries. The corresponds to a thin client calling a web service.
Paths and URIs
To be continued
Querying
To be continued
Authentication
Authentication is assumed to have taken place before any of these calls are made.
To be continued
Exception handling
Currently exceptions (e.g. user not authenticated etc) are not defined as part of this interface, but they could be.
To be continued
Specification
EHR Management
Description |
Signature |
Details |
---|---|---|
Create EHR |
HierObjectId CreateEHR(EhrStatus ehrStatus, AuditDetails commitAudit) |
Parameters |
Find EHR |
HierObjectId FindEHR(PartyRef subjectExternalRef) |
Parameters |
Get EHR Status |
Version<EhrStatus> GetEHRStatus(HierObjectId ehrId, string versionTime) |
Parameters |
EHR Contributions
Description |
Signature |
Details |
---|---|---|
Commit Contribution |
void CommitContribution( HierObjectId ehrId, AuditDetails commitAudit, OriginalVersion[] versions) |
Parameters |
Compositions
Description |
Signature |
Details |
---|---|---|
Find Compositions |
ResultSet FindCompositions( HierObjectId ehrId, string[] compositionPaths, ArchetypeId compositionArchetypeId, string[] compositionCriteria) |
Parameters |
Get Composition |
XVersionedObject<Composition> GetComposition(HierObjectId objectId) |
Parameters |
Get Composition |
Version<Composition> GetComposition(HierObjectId objectId, string versionTime) |
Parameters |
Get Composition |
Version<Composition> GetComposition(ObjectVersionId versionUid) |
Parameters |
EHR Queries
Description |
Signature |
Details |
---|---|---|
Execute Query |
ResultSet ExecuteQuery(string queryStatement, string versionTime) |
Parameters |
Data Structures
ResultSet
XML schema data view
<xs:complexType name="ResultSet"> <xs:sequence> <xs:element minOccurs="0" name="name" type="xs:string" /> <xs:element minOccurs="0" name="totalResults" type="xs:int" /> <xs:element minOccurs="0" maxOccurs="unbounded" name="columns" nillable="true"> <xs:complexType> <xs:sequence> <xs:element name="name" type="xs:string" /> <xs:element minOccurs="0" name="path" type="xs:string" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element minOccurs="0" name="rows"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" maxOccurs="unbounded" name="row"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" maxOccurs="unbounded" name="items" nillable="true" /> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType>
C# / Java
The following is C#.Net code, the Java code will be very similar, with different ancestor classes providing iteration / list capabilities.
// a ResultSet has a name, a count of rows, its definition (list of columnDefs), and the row data public class ResultSet { string Name { get; set; } int TotalResults { get; set; } ResultColumnDef[] Columns { get; set; } ResultRow[] Rows { get; set; } } // the definition of the result set as a logical set of columns, // mapped to archetyped data structures via paths public class ResultColumnDef { string Path { get; set; } // an archetype or RM path string Name { get; set; } // name of the column in this result set } // a row object from which cell objects can be obtained, via either an integer index (0-based) or the column name // Here, 'object' is the 'Any' object of the programming language; it can be anything from a String, Integer etc, // to a DV_CODED_TEXT or other openEHR Data type, to an Observation or Composition, from the main openEHR RM. // What the objects are is completely dependent on what the query paths refer to. public class ResultRow { object[] Items { get; set;} }
Modes of access
Data in a ResultSet can be accessed in the following ways.
ResultSet results; results.Rows[0].Items[0] // first row, first cell results.Rows[5].Items[13] // 6th row, 14th cell results.Rows[0].Items["name/value"] // first row, 'name/value' column