Skip to content

Commit

Permalink
Update FhirSRV.java
Browse files Browse the repository at this point in the history
  • Loading branch information
vincenzo-ingenito committed Sep 25, 2024
1 parent 07c24ab commit 83edd3d
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,10 @@ private DocumentEntryDTO createDocumentEntry(final org.jsoup.nodes.Document docC
}

List<String> referenceIdList = buildReferenceIdList(docCDA, "ClinicalDocument > inFulfillmentOf > order > id");
de.setReferenceIdList(referenceIdList);
if(!referenceIdList.isEmpty()) {
de.setReferenceIdList(referenceIdList);
}


} catch(final Exception ex) {
log.error("Error while create document entry : " , ex);
Expand All @@ -259,7 +262,7 @@ private List<String> buildReferenceIdList(final org.jsoup.nodes.Document docCDA,
Elements elements = docCDA.select(path);
if(!elements.isEmpty()) {
for(Element el : elements) {
String nre = el.attr(EXTENSION_ATTRIBUTE);
String nre = el.attr("root");
if("2.16.840.1.113883.2.9.4.3.9".equals(nre)) {
String extension = el.attr(EXTENSION_ATTRIBUTE);
out.add(extension+"^^^&2.16.840.1.113883.2.9.4.3.8"+REFERENCE_ID_LIST_SUFFIX);
Expand Down

0 comments on commit 83edd3d

Please sign in to comment.