This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"resourceType": "Bundle", | |
"identifier": { | |
"system": "https://tools.ietf.org/html/rfc4122", | |
"value": "d124df3f-e966-46c7-9159-401af1974541" | |
}, | |
"type": "document", | |
"entry": [ | |
{ | |
"fullUrl": "urn:uuid:37f316aa-94a7-4659-90fd-1d605095cf64", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="ISO-8859-1"?><html xmlns="http://www.w3.org/1999/xhtml" xmlns:fhir="http://hl7.org/fhir"> | |
<head> | |
<title>Patient Summary Care Record</title> | |
<style type="text/css"> | |
body { color: #000000; font-size: 10pt; line-height: normal; font-family: Verdana, Arial, sans-serif; margin: 10px; } | |
h1 { font-size: 14pt; text-decoration: underline; font-weight: bold; color: #000000; margin-top: 25px; margin-bottom: 15px;} | |
h2 { font-size: 12pt; text-decoration: underline; font-weight: bold; color: #000000; margin-top: 25px; margin-bottom: 15px; } | |
h3 { font-size: 10pt; font-weight: bold; color: #000000; margin-top: 5px; margin-bottom: 15px; } | |
h4 { font-size: 10pt; font-weight: bold; text-decoration: underline; color: #000000; margin-top: 5px; margin-bottom: 15px; } | |
h5 { font-size: 10pt; font-weight: normal; text-decoration: underline; color: #000000; margin-top: 5px; margin-bottom: 15px; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private DocumentReference getSimple() { | |
Binary binary = new Binary(); | |
binary.setId(UUID.randomUUID().toString()); | |
String dummyContent = "<!DOCTYPE html><html><body>SOME TEXT</body></html>"; | |
binary.setContent (dummyContent.getBytes()); | |
binary.setContentType("text/html"); | |
//System.out.println(FhirContext.forDstu3().newJsonParser().setPrettyPrint(true).encodeResourceToString(binary)); | |
DocumentReference doc = new DocumentReference(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Patient patient = null; | |
IGenericClient clientCCRI = ctxFHIR.newRestfulGenericClient("https://directory.spineservices.nhs.uk/STU3/"); | |
clientODS.setEncoding(EncodingEnum.XML); | |
Bundle patientSearchbundle = clientCCRI | |
.search() | |
.forResource(Patient.class) | |
.where(Patient.IDENTIFIER.exactly().systemAndCode("https://fhir.nhs.uk/Id/nhs-number","9658220169")) | |
.returnBundle(Bundle.class) | |
.execute(); | |
if (patientSearchbundle.getEntry().size()>0) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IGenericClient clientODS = ctxFHIR.newRestfulGenericClient("https://directory.spineservices.nhs.uk/STU3/"); | |
clientODS.setEncoding(EncodingEnum.XML); | |
Organization organization = clientODS | |
.read() | |
.resource(Organization.class) | |
.withId("RR8").execute(); | |
organization.setId(UUID.randomUUID().toString()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary binary = new Binary(); | |
binary.setId(UUID.randomUUID().toString()); | |
String dummyContent = "<!DOCTYPE html><html><body>SOME TEXT</body></html>"; | |
binary.setContent (dummyContent.getBytes()); | |
binary.setContentType("text/html"); | |
System.out.println(FhirContext.forDstu3().newJsonParser().setPrettyPrint(true).encodeResourceToString(binary)); | |
DocumentReference doc = new DocumentReference(); | |
doc.setId(UUID.randomUUID().toString()); | |
doc.setSubject(new Reference("https://demographics.spineservices.nhs.uk/STU3/Patient/9658220169")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DocumentReference doc = new DocumentReference(); | |
doc.setSubject(new Reference("https://demographics.spineservices.nhs.uk/STU3/Patient/9658218881")); | |
doc.setStatus(Enumerations.DocumentReferenceStatus.CURRENT); | |
doc.getType().addCoding() | |
.setSystem("http://snomed.info/sct") | |
.setCode("734163000") | |
.setDisplay("Care Plan"); | |
doc.addAuthor() .setReference("https://directory.spineservices.nhs.uk/STU3/Organization/RR8").setDisplay("LEEDS TEACHING HOSPITALS NHS TRUST"); | |
doc.setIndexed(new Date()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary binary = new Binary(); | |
String dummyContent = "<!DOCTYPE html><html><body>SOME TEXT</body></html>"; | |
binary.setContent (dummyContent.getBytes()); | |
binary.setContentType("text/html"); | |
System.out.println(FhirContext.forDstu3().newJsonParser().setPrettyPrint(true).encodeResourceToString(binary)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bundle bundle = new Bundle(); | |
bundle.addEntry().setResource(doc); | |
bundle.addEntry().setResource(binary); | |
System.out.println(FhirContext.forDstu3().newJsonParser().setPrettyPrint(true).encodeResourceToString(bundle)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bundle bundle = new Bundle(); | |
bundle.addEntry().setResource(doc).setFullUrl("urn:uuid:"+doc.getId()); | |
bundle.addEntry().setResource(binary).setFullUrl("urn:uuid:"+binary.getId()); | |
bundle.setType(Bundle.BundleType.COLLECTION); | |
System.out.println(FhirContext.forDstu3().newJsonParser().setPrettyPrint(true).encodeResourceToString(bundle)); |