Prior to connecting to any API, your administrator should setup an Application identity and a Device identity (if not using two-way TLS).
Note: You should complete the Obtaining A Session example prior to using this tutorial.
Getting Conformance Statement
SanteDB iCDR servers can operate in a multitude of roles, as such, some FHIR resources your application uses may have been disabled by the administrator. It is a good practice to obtain the FHIR conformance statement prior to executing operations against the FHIR server. This is done by:
HTTP/1.1 200 OKContent-Length:8410Content-Type:application/fhir+jsonContent-Location:http://mpi-test.local:8080/fhirmetadataServer:Microsoft-HTTPAPI/2.0X-PoweredBy:SanteDB v2.0.60.25971 (Montreal)X-GeneratedOn:2021-01-11T12:24:07.0378833-05:00Access-Control-Allow-Origin:*Access-Control-Allow-Methods:OPTIONS,POST,PUT,PATCH,DELETE,GETAccess-Control-Allow-Headers:Content-Type,Accept-Encoding,Content-EncodingDate:Mon, 11 Jan 2021 17:24:07 GMT{"resourceType":"CapabilityStatement",
Searching Data
You can locate data on the FHIR service by executing the appropriate GET operation against the requested resource, for example, to find a patient who presents an identifier of 799229340878 you could execute the following query:
GET http://mpi-test.local:8080/fhir/Patient?identifier=799229340878 HTTP/1.1User-Agent:FiddlerHost:mpi-test.local:8080Accept:application/fhir+jsonAuthorization:bearer E878ABAE3054EB11AFFD00155D640B2349E9BDE39EBC9082EE1D45358EC838D18122DF3FC1EFE649858826108F5881C6
Which will return the structured data for that patient in a FHIR Bundle:
HTTP/1.1 200 OKContent-Length:3733Content-Type:application/fhir+jsonLast-Modified:Mon, 11 Jan 2021 12:28:55 GMTServer:Microsoft-HTTPAPI/2.0X-PoweredBy:SanteDB v2.0.60.25971 (Montreal)X-GeneratedOn:2021-01-11T12:28:56.0462209-05:00Access-Control-Allow-Origin:*Access-Control-Allow-Methods:OPTIONS,POST,PUT,PATCH,DELETE,GETAccess-Control-Allow-Headers:Content-Type,Accept-Encoding,Content-EncodingDate:Mon, 11 Jan 2021 17:28:56 GMT{"resourceType...
Submitting Data
To submit data, you should create an HTTP POST (to create a new resource) or PUT (to update an existing resource) to the appropriate URI defined by the FHIR standard. For example, to create a new patient John Test
This will create a new patient and return the created data:
HTTP/1.1 201 CreatedContent-Length:2770Content-Type:application/fhir+jsonContent-Location:http://mempi-test.local:8080/fhir/Patient/f41833f0-5620-472e-bd6f-29d2cbb65a59/_history/Last-Modified:Mon, 11 Jan 2021 12:48:40 GMTETag:W/""Server:Microsoft-HTTPAPI/2.0X-PoweredBy:SanteDB v2.0.60.25971 (Montreal)X-GeneratedOn:2021-01-11T12:48:42.2124309-05:00Access-Control-Allow-Origin:*Access-Control-Allow-Methods:OPTIONS,POST,PUT,PATCH,DELETE,GETAccess-Control-Allow-Headers:Content-Type,Accept-Encoding,Content-EncodingDate:Mon, 11 Jan 2021 17:48:42 GMT{"resourceType":"Patient ...
MDM Master
If you're running the iCDR in MDM mode, the returned resource will be the generated LOCAL record for this patient. The iCDR will generate a MASTER record which expressed in the refer link: