Escolar Documentos
Profissional Documentos
Cultura Documentos
Target Audience:
EHR Developers
EHR Administrators
EPR Systems Developers
This document has been produced with the financial assistance of the European Union.
The views expressed herein can in no way be taken to reflect the official opinion of the European Union.
4. RESOURCES ........................................................................................................................................... 13
List of Tables
2. RESTFul Principles
The following sections expand the four basic design principles to be followed in the implementation
of a REST Web Services and propose a technical rationale for why they might be important for REST
Web Service designers.
2.2 Be Stateless
REST Web Services need to scale to meet increasingly high performance demands. Clusters of
servers with load-balancing and failover capabilities, proxies, and gateways are typically arranged in
a way that forms a service topology, which allows requests to be forwarded from one server to the
http://www.myservice.org/discussion/topics/{topic}
http(s)://server{/path}
The path part is optional. Each resource type defined in this specification has manager which can be
accessed like “/[type]” where the type is the name of the resource.
For the Serbian EHR system, the service root URL is defined like:
http(s)://ehr.eu-ihis.rs/ehr
All the logical interactions are defined relative to the service root URL. This means that if the address
of any one EHR resource on a system is known, the address of other resources may be determined.
2XX Success
Content-Type
application/hl7-v3+xml
Interaction Description
3.5.1 Read
The read interaction accesses the current contents of a resource. The interaction is performed by an
HTTP GET command as shown:
GET [base]/[type]/[id]
3.5.2 Create
The create interaction creates a new resource in a server assigned location. The create interaction is
performed by an HTTP POST command as shown:
POST [base]/[type]
The server returns a 201 Created, along with a Location header which contains the new logical Id of
the created resource:
Location: [base]/[type]/[id]
[id] is the newly created Id for the resource. When the payload data is incorrect and cannot be used
to create a new resource, the server returns a 422 Unprocessable Entity error code.
Common HTTP status codes returned on EHR create interaction are:
HTTP code Description
Resource is successfully created. Logical Id of the created resource is
201 Created
given by a Location header field.
400 Bad Request Resource could not be parsed.
405 Method Not Allowed Creation of the proposed resource is not allowed.
Server refuses to create a resource because of reasons specific to that
409 Conflict
resource (e.g., the resource already exists).
The proposed resource failed applicable EHR document validation or
422 Unprocessable Entity
EHR server rules.
3.5.3 Update
The update interaction creates a new current version for an existing resource. The update
interaction is performed by an HTTP PUT command as shown:
If the interaction is successful, the server SHALL return either a 200 OK if the resource was updated,
with a Last-Modified header.
Servers are permitted to reject update interactions because of integrity concerns or business rules
implemented on the server, and return HTTP status codes accordingly (usually 422). A server
SHOULD accept the resource as submitted when accepts the update.
Common HTTP status codes returned on EHR update interaction are:
HTTP code Description
200 OK Resource is successfully updated.
400 Bad Request Resource could not be parsed.
404 Not Found Resource type not supported, or not EHR endpoint
405 Method Not Allowed Update of specified resource is not allowed.
Server refuses to update a resource because of reasons specific to
409 Conflict
that resource (e.g., referential integrity).
The proposed resource failed applicable EHR document validation or
422 Unprocessable Entity
EHR server rules.
3.5.4 Delete
The delete interaction removes an existing resource. The interaction is performed by an HTTP
DELETE command as shown:
DELETE [base]/[type]/[id]
A delete interaction means that non-version specific reads of a resource return a 410 error and that
the resource is no longer found through search interactions.
Common HTTP status codes returned on EHR delete interaction are:
HTTP code Description
200 OK Resource is successfully deleted.
404 Not Found Resource with specified Id is not found on the server.
405 Method Not Allowed Deletion of specified resource is not allowed.
Server refuses to delete a resource because of reasons specific to that
409 Conflict
resource (e.g., referential integrity).
Resource requested to be deleted is no longer available on the server
410 Gone
(e.g., the resource has been previously deleted).
GET [base]?[parameters]
If the search fails, the return value is a status code 4xx or 5xx with description of the error. If the
search succeeds, the return contains the results of the.
GET [base]/[resourcetype](?[parameters])
For this RESTful search, the parameters are a series of name=[value] pairs encoded in the URL. A
HTTP status code of 403 signifies that the server refused to perform the query, while some other 4xx
or 5xx code signifies that some error occurred.
The search parameters can have modifiers that can control their behaviour. The modifiers depend of
the parameter type.
3.6.2.1 Modifiers
Parameters are defined per resource, and their names may additionally specify a modifier as a suffix,
separated from the parameter name by a colon. Modifiers are:
• For all parameters (except combination): ":missing". E.g. gender:missing=true (or false).
Searching for "gender:missing=true" will return all the resources that don't have any value for
the gender parameter (which usually equates to not having the relevant element in the
resource). Searching for "gender:missing=false" will return all the resources that have a value for
the "gender" parameter.
• For string: ":exact" (the match needs to be exact, no partial matches, case sensitive and accent-
sensitive), instead of the default behaviour, which is that the search does partial matches. It is at
the discretion of the server whether to do a left-partial search.
• For token: ":text" (the match does a partial searches on the text portion of a CodeableConcept
or the display portion of a Coding), instead of the default search which uses codes.
3.6.2.2 Number
The prefixes >, >=, <=, and < may be used on the parameter value, and have the usual meaning. Note
that "=" must be escaped in the value in a URL. Examples:
[parameter]=100 Values that equal 100.
[parameter]=<100 Values that are less than 100.
[parameter]=<=100 Values that are less or equal to 100.
[parameter]=>100 Values that are greater than 100.
[parameter]=>=100 Values that are equal or greater than 100.
3.6.2.3 Date
A date parameter searches on a date/time or period. The prefixes >, >=, <=, and < may be used on
the parameter value, and have the usual meaning. However, as is usual for date/time related
functionality, while the concepts are relatively straight-forward, there are a number of subtleties
involved in ensuring consistent behaviour.
• The date parameter format is yyyy-mm-ddThh:nn:ss(TZ) (the standard XML format).
GET [base-url]/encounter?date=>2010-01-01&date=<2011-12-31
3.6.2.4 String
The string parameter refers to simple string searches against sequences of characters. Matches are
case insensitive. By default, a match exists if a portion of the parameter value contains the specified
string. It is at the discretion of the server whether to do a left-partial search. The modifier :exact can
be used to indicate that the match needs to be exact (the whole string, including casing and
accents). For example:
GET [base-url]/Patient?name=eve
GET [base-url]/Patient?name:exact=Eve
The first is a request to find any patients with "eve" in any part of the name. This would include
patients with the name "Eve", "Severine", etc. The second search would only return patients with
the name "Eve".
3.6.2.5 Token
A token type is a parameter that searches on a code or identifier value where the value may have a
scope of its meaning.
If the parameter has no modifier, the search is performed against the URI/value from a Coding or an
Identifier. The syntax for the value is one of the following:
• [parameter]=[code] matches a code/value irrespective of its system namespace
• [parameter]=[namespace]|[code] matches a code/value in the given system namespace
4. Resources
Resources within EHR, i.e., instance of data that is stored or exchanged, are divided into groups:
• Administrative,
• Clinical.
Resource Description
Demographics and other administrative information about a person receiving
Patient
care or other health-related services.
Demographics and qualification information for an individual who is directly
Practitioner
or indirectly involved in the provisioning of healthcare.
4.1.1 Patient
This resource is used for administrative interactions with demographic data of the patient.
Interactions include process of registration patient within EHR, update of the patient demographic
data, change of status and deletion from EHR.
Supported interactions are:
Interaction Description
Not implemented: EHR does not return demographic/administrative data of
Search
a patient at this phase of the project.
Create To create a patient record with administrative data in the EHR.
Not implemented: EHR does not return demographic/administrative data of
Read
a patient at this phase of the project.
Update To update existing administrative data of a patient in the EHR.
Delete To delete a patient record from the EHR.
4.1.1.1 Create
This interaction is used to register a patient in the EHR. It is initiated by a healthcare institution
where a patient is treated, an Encounter Summary is to be sent and no previous record of the
patient exists in the EHR.
POST /services/patient HTTP/1.1
Host: ehr.eu-ihis.rs
Content-Type: application/hl7-v3+xml
<?xml version="1.0"?>
<ClinicalDocument>
In case of successful registration, the response is to contain the unique Id assigned to the patient
inside the EHR system.
URL Sample:
• https://ehr.eu-ihis.rs/ehr/services/patient
To register a patient in the EHR with the demographic/administrative data specified in the body
of the request through the Patient Registration document.
4.1.1.2 Update
This interaction is used to update existing administrative data of a patient in the EHR. Update of
administrative data is possible only for institution responsible for the patient.
PUT /services/patient/[id] HTTP/1.1
Host: ehr.eu-ihis.rs
Content-Type: application/hl7-v3+xml
<?xml version="1.0"?>
<ClinicalDocument>
...
</ClinicalDocument>
The path variable [id] is the identification of the patient. This interaction implies a full update, i.e., all
demographical data of a patient will be updated independently of the specific data that have been
changed.
URL Sample:
• https://ehr.eu-ihis.rs/ehr/services/patient/1000000555
To update the demographic/administrative data of the patient with EHR id=1000000555 as
specified in the body of the request through the Patient Update document.
4.1.1.3 Delete
This interaction is used to delete a patient record from the EHR. Deletion of patient administrative
data will be available only for authorized institutions and healthcare professionals. Deletion of
administrative data will trigger also deletion of clinical data for patient.
DELETE services/patient/[id] HTTP/1.1
Host: ehr.eu-ihis.rs
The path variable [id] represents Id of the patient to be deleted from EHR. Deletion operation cannot
be reverted and in case of wrong deletion, the patient must be registered again.
URL Sample:
• https://ehr.eu-ihis.rs/ehr/services/patient/1000000555
To delete from the EHR the record of the patient with EHR id=1000000555.
4.1.2.1 Create
This interaction is used to register a healthcare professional in the EHR. Creation of the healthcare
professional is initiated by the health institution when a new healthcare professional is registered
inside its system.
POST services/practitioner HTTP/1.1
Host: ehr.eu-ihis.rs
Content-Type: application/hl7-v3+xml
<?xml version="1.0"?>
<Practitioner>
...
</ Practitioner >
In case of successful registration the response is to contain the unique Id assigned to the healthcare
professional inside the EHR system.
URL Sample:
• https://ehr.eu-ihis.rs/ehr/services/practitioner
To register a healthcare professional in the EHR with the demographic/administrative data
specified in the body of the request through the Healthcare Professional Registration document.
4.1.2.2 Update
This interaction is used to update existing administrative data of a healthcare professional in the
EHR.
The path variable [id] is the identification of the healthcare professional. This interaction implies a
full update, i.e., all demographical data of a healthcare professional will be updated independently
of the specific data that have been changed.
URL Sample:
• https://ehr.eu-ihis.rs/ehr/services/practitioner/1000000888
To update the demographic/administrative data of the patient with EHR id=1000000555 as
specified in the body of the request through the Healthcare Professional Update document.
4.1.2.3 Delete
This interaction is used to delete a healthcare professional record from the EHR. Deletion of
healthcare professional administrative data will be available only for authorized institutions.
DELETE services/practitioner/[id] HTTP/1.1
Host: ehr.eu-ihis.rs
The path variable [id] represents Id of the healthcare professional to be deleted from the EHR.
Deletion operation cannot be reverted and in case of wrong deletion, the healthcare professional
must be registered again.
URL Sample:
• https://ehr.eu-ihis.rs/ehr/services/clinicaldocument/practitioner/1000000888
To delete from the EHR the record of the healthcare professional with EHR id=1000000888.
4.2.1 Encounter
This resource is used to support the exchange of HL7 CDA Encounter Summary documents e
Supported interactions are:
Interaction Description
Interaction to search Encounter Summary documents in the EHR. It returns
Search
the list of documents meeting the search parameter-based criteria specified.
Interaction to send a new Encounter Summary document to the EHR to add
Create related health data to the corresponding patient's record in the EHR
database as well as register and store the document in its original form..
Read Interaction to retrieve a Encounter Summary document from the EHR.
Interaction to send an Encounter Summary document to the EHR to update
related health data of the corresponding patient's record in the EHR
Update
database as well as register the new version of the document. Old version of
the document and related data will be marked as "obsolete".
Interaction to delete an Encounter Summary document from the EHR. This
Delete interaction will delete the specified document and associated health data
from the corresponding patient record in the EHR database.
4.2.1.1 Search
Supported search queries:
GET services/clinicaldocument/encounter?{parameters}
Host: ehr.eu-ihis.rs
The response is to contain the the list of documents meeting the search parameter-based criteria, if
any.
Supported search parameters are:
URL Samples:
• https://ehr.eu-ihis.rs/ehr/services/clinicaldocument/encounter?date=>=2014-05-02
To get the list of all Encounter Summary documents created since the 5th of May 2014, included.
• https://ehr.eu-ihis.rs/ehr/services/clinicaldocument/encounter?date=>=2013-05-
05&date=<=2013-06-05
To get the list of all Encounter Summary documents created from the 5th of May until the 5th of
June 2014, both dates included.
• https://ehr.eu-
ihis.rs/ehr/services/clinicaldocument/encounter?subject=2.16.688.1.1.2.1|123456789012
3
To get the list of all Encounter Summary documents of the patient with JMBG=1234567890123.
4.2.1.2 Create
Purpose of this interaction is to send a new Encounter Summary document to the EHR to add related
health data to the corresponding patient's record in the EHR database as well as register and store
the document in its original form. Interaction is defined as:
POST services/clinicaldocument/encounter HTTP/1.1
Host: ehr.eu-ihis.rs
Content-Type: application/hl7-v3+xml
<?xml version="1.0"?>
<ClinicalDocument>
...
</ClinicalDocument>
In case of successful interaction, the response is to contain the EHR Id of the document which can be
used to track the document within the EHR.
URL Sample:
• https://ehr.eu-ihis.rs/ehr/services/clinicaldocument/encounter
To register and store in the EHR the Encounter Summary document specified in the body of the
request and to add related health data to the corresponding patient's record.
In case of successful interaction, the response is to contain the specified Encounter Summary
document.
URL Sample:
• https://ehr.eu-ihis.rs/ehr/services/clinicaldocument/encounter/111222333
To retrieve the Encounter Summary document with EHR Id=11122233.
4.2.1.4 Update
Purpose of this interaction is to register and store a new version of an Encounter Summary
document in the EHR as well as to update related health data from the corresponding patient's
record in the EHR database. This request implies a full update, i.e., partial update of data is not
allowed and it is necessary to send complete new version of the document.
PUT services/clinicaldocument/encounter/[id] HTTP/1.1
Host: ehr.eu-ihis.rs
Content-Type: application/hl7-v3+xml
<?xml version="1.0"?>
<Clinicaldocument>
...
</ClinicalDocument>
The path variable [id] represents Id of the existing document, for which the update is requested.
URL Sample:
• https://ehr.eu-ihis.rs/ehr/services/clinicaldocument/encounter/111222333
To replace the Encounter Summary document with EHR Id= 111222333 with the new version of
the document specified in the body of the request, and to update related health data from the
corresponding patient's record.
4.2.1.5 Delete
Purpose of this interaction is to delete an Encounter Summary document from EHR i.e., to delete the
specified document and associated health data from the corresponding patient record in the EHR
database.
DELETE services/clinicaldocument/encounter/[id]
Host: ehr.eu-ihis.rs
4.2.2 Hospitalization
This resource is used to support HL7 CDA Hospitalization Report documents exchange between
institutions.
Supported interactions are:
Interaction Description
4.2.2.1 Search
Purpose of this interaction is to search for existing Hospitalization Reports within EHR based on the
search parameters criteria specified.
GET services/clinicaldocument/hospitalization?{parameters}
Host: ehr.eu-ihis.rs
The response is to contain the the list of documents meeting the search parameter-based criteria, if
any.
Supported search parameters are:
Parameter Description Type Optionality
URL Samples:
• https://ehr.eu-ihis.rs/ehr/services/clinicaldocument/hospitalization?date=>=2014-05-02
To get the list of all Hospitalization Reports created since 5th of May 2014, included.
• https://ehr.eu-ihis.rs/ehr/services/clinicaldocument/hospitalization?date=>=2013-05-
05&date=<=2013-06-05
To get the list of all Hospitalization Reports from 5th of May until the 5th June 2014, both dates
included.
• https://ehr.eu-
ihis.rs/ehr/services/clinicaldocument/hospitalization?subject=2.16.688.1.1.2.1|123456789
0123
To get the list of all Search all Hospitalization Reports for the patient with
JMBG=1234567890123.
4.2.2.2 Create
Purpose of this interaction is to send a new Hospitalization Report to the EHR to be registered and
stored in its original form. Interaction is defined as:
POST services/clinicaldocument/hospitalization HTTP/1.1
Host: ehr.eu-ihis.rs
Content-Type: application/hl7-v3+xml
<?xml version="1.0"?>
<ClinicalDocument>
...
</ClinicalDocument>
In case of successful interaction, the response is to contain the EHR Id of the document which can be
used to track the document within the EHR.
URL Sample:
• https://ehr.eu-ihis.rs/ehr/services/clinicaldocument/hospitalization
To register and store in the EHR the Hospitalization Report specified in the body of the request.
4.2.2.3 Read
Purpose of this interaction is to retrieve a Hospitalization Report from the EHR. Interaction is defined
as:
GET services/clinicaldocument/hospitalization/[id] HTTP/1.1
Host: ehr.eu-ihis.rs
4.2.2.4 Update
Purpose of this interaction is to register and store a new version of a Hospitalization Report in the
EHR. This request implies a full update, i.e., partial update of data is not allowed and it is necessary
to send complete new version of the document.
PUT services/clinicaldocument/hospitalization/[id] HTTP/1.1
Host: ehr.eu-ihis.rs
Content-Type: application/hl7-v3+xml
<?xml version="1.0"?>
<ClinicalDocument>
...
</ClinicalDocument>
The path variable [id] represents Id of the existing document, for which the update is requested.
URL Sample:
• https://ehr.eu-ihis.rs/ehr/services/clinicaldocument/hospitalization/222333444
To replace the Hospitalization Report with EHR Id= 222333444 with the new version of the
document specified in the body of the request.
4.2.2.5 Delete
Purpose of this interaction is to delete a Hospitalization Report document from the EHR.
DELETE services/clinicaldocument/hospitalization/[id]
Host: ehr.eu-ihis.rs
Only authorized organizations and healthcare professionals will be authorized for deletion of the
document.
URL Samples:
• https://ehr.eu-ihis.rs/ehr/services/clinicaldocument/hospitalization/222333444
To delete the Hospitalization Report with EHR Id=222333444.
4.2.3.1 Search
Purpose of this interaction is to search and retrieve the Patient Summary document of a patient.
GET services/clinicaldocument/patientsummary?{parameters}
Host: ehr.eu-ihis.rs
The response is to contain the Patient Summary document requested based on the search
parameters specified.
Supported search parameters are:
Parameter Description Type Optionality
Patient identifier (JMBG, LBO, or other allowed patient
subject token Mandatory
identifier)
date Date search parameter. date Optional
URL Samples:
• http://ehr.eu-ihis.rs/ehr/services/clinicaldocument/patientsummary?subject=EE83CE85-
099A-4BFE-8180-BEAC712CEA6A
To search and retrieve the Patient Summary document of the patient with EHR Id= EE83CE85-
099A-4BFE-8180-BEAC712CEA6A.
• https://ehr.eu-
his.rs/ehr/services/clinicaldocument/patientsummary?subject=2.16.688.1.1.2.1|12345678
90123&date=>=2013-05-05&date=<=2013-06-05
To search and retrieve the Patient Summary document of the patient with
JMBG=1234567890123 covering the specified period.