Skip to content

Instantly share code, notes, and snippets.

@KevinMayfield
Created December 6, 2018 15:32
Show Gist options
  • Save KevinMayfield/e94e947d3642649b4b58ca56daa0126f to your computer and use it in GitHub Desktop.
Save KevinMayfield/e94e947d3642649b4b58ca56daa0126f to your computer and use it in GitHub Desktop.
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());
doc.getContext().getPracticeSetting().addCoding()
.setSystem("http://snomed.info/sct")
.setCode("408467006")
.setDisplay("Adult mental illness");
System.out.println(FhirContext.forDstu3().newJsonParser().setPrettyPrint(true).encodeResourceToString(doc));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment