Skip to content

Instantly share code, notes, and snippets.

View IOPS-DEV's full-sized avatar

NHS Digital - Interoperability Team IOPS-DEV

View GitHub Profile
@IOPS-DEV
IOPS-DEV / bus_ack_error_example-01.xml
Last active August 15, 2018 15:51
Business acknowledgement error example
<response>
<identifier value="ea7221b8-3cc0-4b11-bc95-585b056b5427"/>
<code value="fatal-error"/>
<details>
<reference value="urn:uuid:f19e4165-b379-4377-ad43-df65f609eba5"/>
</details>
</response>
....................
<resource>
<OperationOutcome>
@IOPS-DEV
IOPS-DEV / file-search-http-response
Last active September 12, 2017 13:18
Search-HTTP-Response
HTTP/1.1 200 OK
Server: nginx/1.10.0 (Ubuntu)
Date: Mon, 19 Jun 2017 08:36:12 GMT
Content-Type: application/fhir+xml;charset=utf-8
Last-Modified: Mon, 19 Jun 2017 08:36:12 GMT
@IOPS-DEV
IOPS-DEV / Leeds-Teaching-Hospital-Example-1.xml
Last active September 4, 2017 13:37
Leeds Teaching Hospital Example 1
<Organization>
<id value="RR8" />
<extension url="https://fhir.nhs.uk/StructureDefinition/STU3/Extension-ODSAPI-ActivePeriod-1">
<valuePeriod>
<extension url="https://fhir.nhs.uk/StructureDefinition/STU3/Extension-ODSAPI-DateType-1">
<valueString value="Operational" />
</extension>
<start value="1998-04-01" />
</valuePeriod>
</extension>
<Organization>
<id value="NMV04" />
<extension url="https://fhir.nhs.uk/StructureDefinition/STU3/Extension-ODSAPI-ActivePeriod-1">
<valuePeriod>
<extension url="https://fhir.nhs.uk/StructureDefinition/STU3/Extension-ODSAPI-DateType-1">
<valueString value="Operational" />
</extension>
<start value="2009-10-01" />
</valuePeriod>
</extension>
@IOPS-DEV
IOPS-DEV / ODS-API-Bundle-Example-1
Last active September 8, 2017 15:03
ODS API Response Bundle
<Bundle>
<id value="e9d221f0-c1f3-4d20-8d83-439721cf659d" />
<meta>
<versionId value="46bd9ffa-ad31-4945-9fc8-ceedb2325d64"></versionId>
<lastUpdated value="2017-09-08T14:37:46.798+00:00"></lastUpdated>
</meta>
<type value="searchset" />
<entry>
<resource>
<Organization>
@IOPS-DEV
IOPS-DEV / ODS-Search.java
Last active September 6, 2017 14:31
Organization Search Java
// Create a FHIR Context - Need to check STU3 syntax and ref on line 13
FhirContext ctx = FhirContext.forSTU3();
IParser parser = ctx.newXmlParser();
// Create a client and post the transaction to the server
IGenericClient client = ctx.newRestfulGenericClient("https://fhir.nhs.uk/STU3/");
System.out.println("GET https://fhir.nhs.uk/STU3/ODSAPI-Organization-1?postalCode=NG10 1QQ");
Bundle results = client
.search()
@IOPS-DEV
IOPS-DEV / ODS-Search-OrgCode.java
Last active September 6, 2017 14:30
ODS Search using Organization Code
public static void searchOrgCode()
{
FhirContext ctx = FhirContext.forSTU3();
IParser parser = ctx.newXmlParser();
// Create a client and post the transaction to the server
IGenericClient client = ctx.newRestfulGenericClient("https://fhir.nhs.uk/STU3/");
System.out.println("GET https://fhir.nhs.uk/STU3/ODSAPI-Organiztion-1?identifier= https://fhir.nhs.uk/Id/ods-organization-code|RR8");
Bundle results = client
@IOPS-DEV
IOPS-DEV / ODS-Search-Org-Role
Created September 8, 2017 14:59
ODS Search Organization Role
//Java code to be added for ODS search org role
@IOPS-DEV
IOPS-DEV / ODS-API-Bundle-Example-2
Last active December 8, 2017 11:50
ODS API Bundle search for Organisation code RXX
<Bundle xmlns="http://hl7.org/fhir">
<id value="8f4daf25-3421-4530-a09f-2e565a2ba002"/>
<meta>
<lastUpdated value="2017-12-09T11:15:19.625+00:00"/>
</meta>
<type value="searchset"/>
<total value="1"/>
<link>
<relation value="self"/>
<url value="https://fhir.nhs.uk/STU3/StructureDefinition/Organization?identifier=RXX"/>