Skip to content

Commit

Permalink
fix: Source id
Browse files Browse the repository at this point in the history
  • Loading branch information
vincenzo-ingenito committed Apr 10, 2024
1 parent 4eef364 commit 294a0f5
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
@Slf4j
public class FhirSRV implements IFhirSRV {

private static final String PATH_CUSTODIAN_ID = "ClinicalDocument > custodian > assignedCustodian > representedCustodianOrganization > id";
private static final String PATH_ID = "ClinicalDocument > id";
private static final String PATH_PATIENT_ID = "ClinicalDocument > recordTarget > patientRole> id";
private static final String EXTENSION_ATTRIBUTE = "extension";

Expand Down Expand Up @@ -141,12 +141,11 @@ private SubmissionSetEntryDTO createSubmissionSetEntry(final org.jsoup.nodes.Doc
sse.setAuthorRole(authorSlotDTO.getAuthorRole());
sse.setPatientId(buildPatient(docCDA));
String sourceIdRoot = "";
final Element custodianPath = docCDA.select(PATH_CUSTODIAN_ID).first();
if (custodianPath != null) {
sourceIdRoot = custodianPath.attr("root");
final Element idPath = docCDA.select(PATH_ID).first();
if (idPath != null) {
sourceIdRoot = idPath.attr("root");
sse.setSourceId(sourceIdRoot.substring(0, sourceIdRoot.length()-4));
}

sse.setSourceId(sourceIdRoot);
sse.setUniqueID(identificativoSottomissione);

sse.setSubmissionTime(new SimpleDateFormat(Constants.Misc.INI_DATE_PATTERN).format(new Date()));
Expand All @@ -159,7 +158,8 @@ private SubmissionSetEntryDTO createSubmissionSetEntry(final org.jsoup.nodes.Doc
}
return sse;
}




private DocumentEntryDTO createDocumentEntry(final org.jsoup.nodes.Document docCDA,
final PublicationCreateReplaceMetadataDTO requestBody, final Integer size, final String hash,
Expand Down Expand Up @@ -206,7 +206,7 @@ private DocumentEntryDTO createDocumentEntry(final org.jsoup.nodes.Document docC
administrativeRequestList.add(en.getCode() + "^" + en.getDescription());
}
de.setAdministrativeRequest(administrativeRequestList);

}

de.setAuthorRole(authorSlotDTO.getAuthorRole());
Expand Down

0 comments on commit 294a0f5

Please sign in to comment.