in src/com/amazonaws/lab/FHIRDataHandler.java [97:120]
private ArrayList<String> getNotesFromBundle(Bundle bundle) {
ArrayList<String> notesList = new ArrayList<String>();
List<BundleEntryComponent> list = bundle.getEntry();
for(BundleEntryComponent entry : list) {
String fhirType = entry.getResource().fhirType();
if(fhirType.equals(ResourceType.DOCUMENTREFERENCE.getDisplay())) {
DocumentReference docRef = (DocumentReference)entry.getResource();
log.debug("The document data "+docRef.getDescription());
List<DocumentReferenceContentComponent> attList = docRef.getContent();
StringBuffer buffer = new StringBuffer();
for(DocumentReferenceContentComponent attach:attList) {
byte[] notesBytes = attach.getAttachment().getData();
log.debug("The provider clinical :"+new String(notesBytes));
buffer.append(new String(notesBytes));
}
notesList.add(buffer.toString());
}
}
return notesList;
}