SlideShare una empresa de Scribd logo
1 de 19
FHIR REST API 
Syed Ali Raza
Instance Level Interactions
Type Level Interactions
Whole System Interactions
API Style Guide 
• OPERATION [base]/[type]/[id] {?_format=[mime-type]} 
• Content surrounded by {} is optional
HTTP Status Codes 
• Specification makes rules about the use of specific HTTP status 
codes in particular circumstances where the status codes SHALL 
map to particular states correctly 
• FHIR defines an OperationOutcome resource that can be used to 
convey specific detailed processable error information. 
• For a few combinations of interactions and specific return codes, an 
OperationOutcome is required to be returned as the content of the 
response. 
• OperationOutcome may be returned with any HTTP 4xx or 5xx 
response, but is not required
Content Types and encodings 
• The correct mime type SHALL be used by clients and 
servers. 
• Servers SHOULD support the optional "_format" parameter 
to specify alternative response formats by their MIME-types.
Content Types and encodings (contd..) 
• For the _format parameter, the values "xml", "text/xml", 
"application/xml", and "application/xml+fhir" SHALL be 
interpreted to mean the normative XML format 
• FHIR uses UTF-8 for all request and response bodies. 
• Responses SHALL explicitly set the character encoding to 
UTF-8 using the 'charset' parameter of the MIME-type in 
the Content-Type header 
• Requests MAY also specify this charset parameter in the 
Accept header
Read (instance-level) 
• GET [base]/[type]/[id] {?_format=[mime-type]} 
• Servers are required to return a content-location header with the 
response and Last-Modified header. 
• Systems that do not track deleted records will treat deleted records 
as an unknown resource. 
Http Method Description 
410 deleted resource 
404 An unknown resource 
200 If found resource
Vread (instance Level) 
• GET [base]/[type]/[id]/_history/[vid] {?_format=[mime-type]} 
Http Method Description 
410 deleted resource 
404 An unknown resource 
405 If a request is made for a previous version of a resource, 
and the server does not support accessing previous 
versions 
200 If found resource
update 
• PUT [base]/[type]/[id] {?_format=[mime-type]} 
• If successful , it will response with a Last-Modified header, and a Location 
and Content-Location header 
Http Method Description 
200 interaction is successful 
201 if the resource was created 
405 the resource did not exist prior to the update 
400(Bad Request ) Resource could not be parsed or failed basic FHIR validation 
404 Resource type not supported, or not a FHIR end point 
409 version conflict management 
422 To reject update interactions because of integrity concerns or 
business rules implemented on the server 
412(Precondition 
Failed) 
For version aware server, Content-Location in the PUT request. 
If the value is missing the will
delete 
• DELETE [base]/[type]/[id] 
• Resources that have been deleted may subsequently be brought back to 
life by PUTting an update to them subsequent to the deletion. 
Http Method Description 
204 successful deletion 
410 resource is no longer found through search interactions 
405 If the server refuses to delete resources of that type on 
principle 
409 If the server refuses to delete a resource because of reasons 
specific to that resource, such as referential integrity
create 
• POST [base]/[type] {?_format=[mime-type]} 
• The server returns a 201 Created, along with a Location 
header which contains the new Logical Id and Version Id 
• Location: [base]/[type]/[id]/_history/[vid] 
• A server SHOULD accept the resource as submitted when 
accepts the create, and return the same content when it is 
subsequently read
Create (contd..) 
Http Method Description 
201 if the resource was created 
400(Bad Request ) Resource could not be parsed or failed basic FHIR 
validation 
404(Not Found) Resource type not supported, or not a FHIR end point 
422(Unprocessable 
Entity) 
the proposed resource violated applicable FHIR profiles 
or server business rules. This should be accompanied by 
anOperationOutcome resource providing additional 
detail
search 
• To search all resources at once: 
– GET [base]?[parameters] {&_format=[mime-type]} 
• To search a single resource type: 
– GET [base]/[type]?[parameters] {&_format=[mime-type]} 
– GET [base]/[type]/_search?[parameters] {&_format=[mime-type]} 
• To search a compartment: 
– GET [base]/[compartment]/[id]/?[parameters] {&_format=[mime-type]} 
– GET [base]/[compartment]/[id]/[type]?[parameters] {&_format=[mime-type]} 
• All these search interactions take a series of 
parameters that are a series of name'='value pairs 
encoded in the URL
search 
• If the search fails, the return value is a status 
code 4xx or 5xx with an OperationOutcome. 
• If the search succeeds, the return content is 
an Bundle containing the results of the search as 
a list of resources in a defined order. 
• If the search succeeds, the return content is 
an Bundle containing the results of the search as 
a list of resources in a defined order.
validate 
• POST [base]/[type]/_validate{/[id]} 
• The content is first checked against the general 
specification and against the conformance profile that 
applies to the application. 
• if the optional [id] section is also provided, the resource is 
considered as a proposed update to the specific resource. 
• Additional instance specific rules such as referential 
integrity and update logic (including version control) are 
applied as well.
Validate (contd..) 
• The client can ask the server to validate 
against a particular resource by attaching 
a profile tag to the resource. 
• This is an assertion that the resource conforms 
to the specified profile(s) 
• The server SHALL check all the things it 
requires of the resource as part of it's normal 
operations
Validate (contd..) 
Http Method Description 
200 resource passed all validation rules 
400(Bad Request ) Resource could not be parsed or failed basic FHIR 
validation 
422(Unprocessable 
Entity) 
the resource was valid, but as a proposed update, it 
violates applicable FHIR profiles or server business rules

Más contenido relacionado

La actualidad más candente

Semantic Similarity Measures for Semantic Relation Extraction
Semantic Similarity Measures for Semantic Relation ExtractionSemantic Similarity Measures for Semantic Relation Extraction
Semantic Similarity Measures for Semantic Relation Extraction
Alexander Panchenko
 
ลักษณะเฉพาะของวิทยาศาสตร์
ลักษณะเฉพาะของวิทยาศาสตร์ลักษณะเฉพาะของวิทยาศาสตร์
ลักษณะเฉพาะของวิทยาศาสตร์
dnavaroj
 
온톨로지 개념 및 표현언어
온톨로지 개념 및 표현언어온톨로지 개념 및 표현언어
온톨로지 개념 및 표현언어
Dongbum Kim
 

La actualidad más candente (20)

Hibernate
HibernateHibernate
Hibernate
 
Тема 1. Вступ. Основні проблеми, що приводять до інтеграції даних. Історія за...
Тема 1. Вступ. Основні проблеми, що приводять до інтеграції даних. Історія за...Тема 1. Вступ. Основні проблеми, що приводять до інтеграції даних. Історія за...
Тема 1. Вступ. Основні проблеми, що приводять до інтеграції даних. Історія за...
 
Semantic Similarity Measures for Semantic Relation Extraction
Semantic Similarity Measures for Semantic Relation ExtractionSemantic Similarity Measures for Semantic Relation Extraction
Semantic Similarity Measures for Semantic Relation Extraction
 
HATEOAS 101 - Opinionated Introduction to a REST API Style
HATEOAS 101 - Opinionated Introduction to a REST API StyleHATEOAS 101 - Opinionated Introduction to a REST API Style
HATEOAS 101 - Opinionated Introduction to a REST API Style
 
JEE Course - JEE Overview
JEE Course - JEE  OverviewJEE Course - JEE  Overview
JEE Course - JEE Overview
 
DSpace-CRIS & OpenAIRE
DSpace-CRIS & OpenAIREDSpace-CRIS & OpenAIRE
DSpace-CRIS & OpenAIRE
 
FHIR architecture overview for non-programmers by René Spronk
FHIR architecture overview for non-programmers by René SpronkFHIR architecture overview for non-programmers by René Spronk
FHIR architecture overview for non-programmers by René Spronk
 
Hibernate Basic Concepts - Presentation
Hibernate Basic Concepts - PresentationHibernate Basic Concepts - Presentation
Hibernate Basic Concepts - Presentation
 
Java EE and Spring Side-by-Side
Java EE and Spring Side-by-SideJava EE and Spring Side-by-Side
Java EE and Spring Side-by-Side
 
ลักษณะเฉพาะของวิทยาศาสตร์
ลักษณะเฉพาะของวิทยาศาสตร์ลักษณะเฉพาะของวิทยาศาสตร์
ลักษณะเฉพาะของวิทยาศาสตร์
 
온톨로지 개념 및 표현언어
온톨로지 개념 및 표현언어온톨로지 개념 및 표현언어
온톨로지 개념 및 표현언어
 
링크드 데이터 사례
링크드 데이터 사례링크드 데이터 사례
링크드 데이터 사례
 
OntoPiA la rete di ontologie e vocabolari controllati per la pubblica amminis...
OntoPiA la rete di ontologie e vocabolari controllati per la pubblica amminis...OntoPiA la rete di ontologie e vocabolari controllati per la pubblica amminis...
OntoPiA la rete di ontologie e vocabolari controllati per la pubblica amminis...
 
Support JEE Servlet Jsp MVC M.Youssfi
Support JEE Servlet Jsp MVC M.YoussfiSupport JEE Servlet Jsp MVC M.Youssfi
Support JEE Servlet Jsp MVC M.Youssfi
 
Princípios de Programação Orientada a Objetos Solid, dry e kiss
Princípios de Programação Orientada a Objetos Solid, dry  e kiss Princípios de Programação Orientada a Objetos Solid, dry  e kiss
Princípios de Programação Orientada a Objetos Solid, dry e kiss
 
Curso de Enterprise JavaBeans (EJB) (JavaEE 7)
Curso de Enterprise JavaBeans (EJB) (JavaEE 7)Curso de Enterprise JavaBeans (EJB) (JavaEE 7)
Curso de Enterprise JavaBeans (EJB) (JavaEE 7)
 
Patient matching in FHIR
Patient matching in FHIRPatient matching in FHIR
Patient matching in FHIR
 
Afinal, o que são Single Page Applications
Afinal, o que são Single Page ApplicationsAfinal, o que são Single Page Applications
Afinal, o que são Single Page Applications
 
Oracle SOA Suite in use – a practical experience report
Oracle SOA Suite in use – a practical experience reportOracle SOA Suite in use – a practical experience report
Oracle SOA Suite in use – a practical experience report
 
AngularJS
AngularJSAngularJS
AngularJS
 

Destacado

Destacado (20)

HL7 Fhir for Developers
HL7 Fhir for DevelopersHL7 Fhir for Developers
HL7 Fhir for Developers
 
FHIR Tutorial - Morning
FHIR Tutorial - MorningFHIR Tutorial - Morning
FHIR Tutorial - Morning
 
FHIR API for .Net programmers by Mirjam Baltus
FHIR API for .Net programmers by Mirjam BaltusFHIR API for .Net programmers by Mirjam Baltus
FHIR API for .Net programmers by Mirjam Baltus
 
Terminology, value-sets, codesystems by Lloyd McKenzie
Terminology, value-sets, codesystems by Lloyd McKenzieTerminology, value-sets, codesystems by Lloyd McKenzie
Terminology, value-sets, codesystems by Lloyd McKenzie
 
SMART on FHIR by Scot Post van der Burg
SMART on FHIR by Scot Post van der BurgSMART on FHIR by Scot Post van der Burg
SMART on FHIR by Scot Post van der Burg
 
FHIR API for Java programmers by James Agnew
FHIR API for Java programmers by James AgnewFHIR API for Java programmers by James Agnew
FHIR API for Java programmers by James Agnew
 
FHIR tutorial - Afternoon
FHIR tutorial - AfternoonFHIR tutorial - Afternoon
FHIR tutorial - Afternoon
 
Introduction to FHIR™
Introduction to FHIR™Introduction to FHIR™
Introduction to FHIR™
 
Healthcare on Fire: A Beginner Guide to HL7 FHIR
Healthcare on Fire: A Beginner Guide to HL7 FHIRHealthcare on Fire: A Beginner Guide to HL7 FHIR
Healthcare on Fire: A Beginner Guide to HL7 FHIR
 
An Introduction to HL7 FHIR
An Introduction to HL7 FHIRAn Introduction to HL7 FHIR
An Introduction to HL7 FHIR
 
Accessing SNOMED CT With FHIR Terminology Services
Accessing SNOMED CT With FHIR Terminology ServicesAccessing SNOMED CT With FHIR Terminology Services
Accessing SNOMED CT With FHIR Terminology Services
 
FHIR architecture overview for non-programmers by René Spronk
FHIR architecture overview for non-programmers by René SpronkFHIR architecture overview for non-programmers by René Spronk
FHIR architecture overview for non-programmers by René Spronk
 
Introduction to HL7 FHIR
Introduction to HL7 FHIRIntroduction to HL7 FHIR
Introduction to HL7 FHIR
 
FHIR - more than the basics
FHIR - more than the basicsFHIR - more than the basics
FHIR - more than the basics
 
дневник пациента монитор эндокринолога
дневник пациента   монитор эндокринологадневник пациента   монитор эндокринолога
дневник пациента монитор эндокринолога
 
Электронный рецепт
Электронный рецептЭлектронный рецепт
Электронный рецепт
 
CCDs or QRDAs for eCQM Reporting
CCDs or QRDAs for eCQM ReportingCCDs or QRDAs for eCQM Reporting
CCDs or QRDAs for eCQM Reporting
 
Security in FHIR with OAuth by Grahame Grieve
Security in FHIR with OAuth by Grahame GrieveSecurity in FHIR with OAuth by Grahame Grieve
Security in FHIR with OAuth by Grahame Grieve
 
Cda
CdaCda
Cda
 
Route from CCDA to FHIR by Grahame Grieve
Route from CCDA to FHIR by Grahame GrieveRoute from CCDA to FHIR by Grahame Grieve
Route from CCDA to FHIR by Grahame Grieve
 

Similar a FHIR REST API

HTTP Status Codes Cheat Sheet: An Exhaustive List
HTTP Status Codes Cheat Sheet: An Exhaustive ListHTTP Status Codes Cheat Sheet: An Exhaustive List
HTTP Status Codes Cheat Sheet: An Exhaustive List
Mainstreethost
 

Similar a FHIR REST API (20)

Rest & RESTful WebServices
Rest & RESTful WebServicesRest & RESTful WebServices
Rest & RESTful WebServices
 
RestfulDesignRules
RestfulDesignRulesRestfulDesignRules
RestfulDesignRules
 
Fhir dev days 2017 fhir profiling - overview and introduction v07
Fhir dev days 2017   fhir profiling - overview and introduction v07Fhir dev days 2017   fhir profiling - overview and introduction v07
Fhir dev days 2017 fhir profiling - overview and introduction v07
 
REST 101: An Overview To Representational State Transfer.
REST 101: An Overview To Representational State Transfer.REST 101: An Overview To Representational State Transfer.
REST 101: An Overview To Representational State Transfer.
 
Pragmatic REST APIs
Pragmatic REST APIsPragmatic REST APIs
Pragmatic REST APIs
 
restapitest-anil-200517181251.pdf
restapitest-anil-200517181251.pdfrestapitest-anil-200517181251.pdf
restapitest-anil-200517181251.pdf
 
Rest API Testing
Rest API TestingRest API Testing
Rest API Testing
 
Rest WebAPI with OData
Rest WebAPI with ODataRest WebAPI with OData
Rest WebAPI with OData
 
L12: REST Service
L12: REST ServiceL12: REST Service
L12: REST Service
 
HTTP Status Codes Cheat Sheet: An Exhaustive List
HTTP Status Codes Cheat Sheet: An Exhaustive ListHTTP Status Codes Cheat Sheet: An Exhaustive List
HTTP Status Codes Cheat Sheet: An Exhaustive List
 
API Testing Using REST Assured with TestNG
API Testing Using REST Assured with TestNGAPI Testing Using REST Assured with TestNG
API Testing Using REST Assured with TestNG
 
RESTful Services
RESTful ServicesRESTful Services
RESTful Services
 
Troubleshooting.pptx
Troubleshooting.pptxTroubleshooting.pptx
Troubleshooting.pptx
 
BITM3730Week9(1).pptx
BITM3730Week9(1).pptxBITM3730Week9(1).pptx
BITM3730Week9(1).pptx
 
ReST
ReSTReST
ReST
 
BITM3730 Networking.pdf
BITM3730 Networking.pdfBITM3730 Networking.pdf
BITM3730 Networking.pdf
 
SFDC Inbound Integrations
SFDC Inbound IntegrationsSFDC Inbound Integrations
SFDC Inbound Integrations
 
Resting on your laurels will get you powned
Resting on your laurels will get you pownedResting on your laurels will get you powned
Resting on your laurels will get you powned
 
BITM3730 11-1.pptx
BITM3730 11-1.pptxBITM3730 11-1.pptx
BITM3730 11-1.pptx
 
Rest APIs Training
Rest APIs TrainingRest APIs Training
Rest APIs Training
 

Más de Syed Ali Raza (7)

E health Demystified
E health DemystifiedE health Demystified
E health Demystified
 
O auth2.0 20141003
O auth2.0 20141003O auth2.0 20141003
O auth2.0 20141003
 
What is a Software Module?
What is a Software Module?What is a Software Module?
What is a Software Module?
 
Hl7 common terminology services
Hl7 common terminology servicesHl7 common terminology services
Hl7 common terminology services
 
Electronic health records
Electronic health recordsElectronic health records
Electronic health records
 
Chap 1
Chap 1Chap 1
Chap 1
 
Resources assort urdu-shadi-al-shadi-047-nikah presentation - 3
Resources assort urdu-shadi-al-shadi-047-nikah presentation - 3Resources assort urdu-shadi-al-shadi-047-nikah presentation - 3
Resources assort urdu-shadi-al-shadi-047-nikah presentation - 3
 

Último

AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 

Último (20)

Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
SHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions PresentationSHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions Presentation
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Generic or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisions
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 

FHIR REST API

  • 1. FHIR REST API Syed Ali Raza
  • 5. API Style Guide • OPERATION [base]/[type]/[id] {?_format=[mime-type]} • Content surrounded by {} is optional
  • 6. HTTP Status Codes • Specification makes rules about the use of specific HTTP status codes in particular circumstances where the status codes SHALL map to particular states correctly • FHIR defines an OperationOutcome resource that can be used to convey specific detailed processable error information. • For a few combinations of interactions and specific return codes, an OperationOutcome is required to be returned as the content of the response. • OperationOutcome may be returned with any HTTP 4xx or 5xx response, but is not required
  • 7. Content Types and encodings • The correct mime type SHALL be used by clients and servers. • Servers SHOULD support the optional "_format" parameter to specify alternative response formats by their MIME-types.
  • 8. Content Types and encodings (contd..) • For the _format parameter, the values "xml", "text/xml", "application/xml", and "application/xml+fhir" SHALL be interpreted to mean the normative XML format • FHIR uses UTF-8 for all request and response bodies. • Responses SHALL explicitly set the character encoding to UTF-8 using the 'charset' parameter of the MIME-type in the Content-Type header • Requests MAY also specify this charset parameter in the Accept header
  • 9. Read (instance-level) • GET [base]/[type]/[id] {?_format=[mime-type]} • Servers are required to return a content-location header with the response and Last-Modified header. • Systems that do not track deleted records will treat deleted records as an unknown resource. Http Method Description 410 deleted resource 404 An unknown resource 200 If found resource
  • 10. Vread (instance Level) • GET [base]/[type]/[id]/_history/[vid] {?_format=[mime-type]} Http Method Description 410 deleted resource 404 An unknown resource 405 If a request is made for a previous version of a resource, and the server does not support accessing previous versions 200 If found resource
  • 11. update • PUT [base]/[type]/[id] {?_format=[mime-type]} • If successful , it will response with a Last-Modified header, and a Location and Content-Location header Http Method Description 200 interaction is successful 201 if the resource was created 405 the resource did not exist prior to the update 400(Bad Request ) Resource could not be parsed or failed basic FHIR validation 404 Resource type not supported, or not a FHIR end point 409 version conflict management 422 To reject update interactions because of integrity concerns or business rules implemented on the server 412(Precondition Failed) For version aware server, Content-Location in the PUT request. If the value is missing the will
  • 12. delete • DELETE [base]/[type]/[id] • Resources that have been deleted may subsequently be brought back to life by PUTting an update to them subsequent to the deletion. Http Method Description 204 successful deletion 410 resource is no longer found through search interactions 405 If the server refuses to delete resources of that type on principle 409 If the server refuses to delete a resource because of reasons specific to that resource, such as referential integrity
  • 13. create • POST [base]/[type] {?_format=[mime-type]} • The server returns a 201 Created, along with a Location header which contains the new Logical Id and Version Id • Location: [base]/[type]/[id]/_history/[vid] • A server SHOULD accept the resource as submitted when accepts the create, and return the same content when it is subsequently read
  • 14. Create (contd..) Http Method Description 201 if the resource was created 400(Bad Request ) Resource could not be parsed or failed basic FHIR validation 404(Not Found) Resource type not supported, or not a FHIR end point 422(Unprocessable Entity) the proposed resource violated applicable FHIR profiles or server business rules. This should be accompanied by anOperationOutcome resource providing additional detail
  • 15. search • To search all resources at once: – GET [base]?[parameters] {&_format=[mime-type]} • To search a single resource type: – GET [base]/[type]?[parameters] {&_format=[mime-type]} – GET [base]/[type]/_search?[parameters] {&_format=[mime-type]} • To search a compartment: – GET [base]/[compartment]/[id]/?[parameters] {&_format=[mime-type]} – GET [base]/[compartment]/[id]/[type]?[parameters] {&_format=[mime-type]} • All these search interactions take a series of parameters that are a series of name'='value pairs encoded in the URL
  • 16. search • If the search fails, the return value is a status code 4xx or 5xx with an OperationOutcome. • If the search succeeds, the return content is an Bundle containing the results of the search as a list of resources in a defined order. • If the search succeeds, the return content is an Bundle containing the results of the search as a list of resources in a defined order.
  • 17. validate • POST [base]/[type]/_validate{/[id]} • The content is first checked against the general specification and against the conformance profile that applies to the application. • if the optional [id] section is also provided, the resource is considered as a proposed update to the specific resource. • Additional instance specific rules such as referential integrity and update logic (including version control) are applied as well.
  • 18. Validate (contd..) • The client can ask the server to validate against a particular resource by attaching a profile tag to the resource. • This is an assertion that the resource conforms to the specified profile(s) • The server SHALL check all the things it requires of the resource as part of it's normal operations
  • 19. Validate (contd..) Http Method Description 200 resource passed all validation rules 400(Bad Request ) Resource could not be parsed or failed basic FHIR validation 422(Unprocessable Entity) the resource was valid, but as a proposed update, it violates applicable FHIR profiles or server business rules

Notas del editor

  1. vread interaction preforms a version specific read of the resource Servers are encouraged to support a version specific retrieval of the current version of the resource even if they are do not provide access to previous versions.
  2. update interaction creates a new current version for an existing resource or creates a new resource if no resource already exists for the given id. Servers MAY choose to preserve XML comments, instructions, and formatting or JSON whitespace when accepting updates, but are not required to do so. The impact of this on digital signatures may need to be considered.
  3. The delete interaction removes an existing resource. 
  4. The create interaction creates a new resource in a server assigned location. If the client wishes to have control over the id of a newly submitted resource,
  5. This interaction searches a set of resources based on some filter criteria..
  6. The validate interaction checks whether the attached content would be acceptable as an update to an existing resource.