-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
3b1bebc
commit 2911b58
Showing
1 changed file
with
19 additions
and
16 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -138,7 +138,7 @@ void writeDocument() { | |
konnektorService.getAuthorInstitutions().stream() | ||
.findFirst() | ||
.orElseThrow(() -> new IllegalStateException("no SMC-B found")); | ||
var document = buildDocumentPayload(documentId, authorInstitution, EXPORT_XML.getBytes()); | ||
var document = buildDocumentPayload(documentId, authorInstitution, hcid, EXPORT_XML.getBytes()); | ||
|
||
// 3) write the FHIR/MIO document | ||
assertDoesNotThrow(() -> konnektorService.writeDocument(recordIdentifier, document)); | ||
|
@@ -161,14 +161,15 @@ void replaceDocument() { | |
.findFirst() | ||
.orElseThrow(() -> new IllegalStateException("no SMC-B found")); | ||
|
||
var document = buildDocumentPayload(documentId, authorInstitution, EXPORT_XML.getBytes()); | ||
var document = buildDocumentPayload(documentId, authorInstitution, hcid, EXPORT_XML.getBytes()); | ||
|
||
// 3) write the FHIR/MIO document | ||
assertDoesNotThrow(() -> konnektorService.writeDocument(recordIdentifier, document)); | ||
|
||
// 4) replace the document | ||
var newDocumentId = UUID.randomUUID(); | ||
var newDocument = buildDocumentPayload(newDocumentId, authorInstitution, EXPORT_XML.getBytes()); | ||
var newDocument = | ||
buildDocumentPayload(newDocumentId, authorInstitution, hcid, EXPORT_XML.getBytes()); | ||
assertDoesNotThrow( | ||
() -> konnektorService.replaceDocument(recordIdentifier, newDocument, documentId)); | ||
} | ||
|
@@ -201,8 +202,9 @@ private KonnektorService buildService() throws Exception { | |
} | ||
|
||
private Document buildDocumentPayload( | ||
UUID id, AuthorInstitution authorInstitution, byte[] contents) { | ||
var repositoryUniqueId = UUID.randomUUID().toString(); | ||
UUID id, AuthorInstitution authorInstitution, String homeCommunityId, byte[] contents) { | ||
var repositoryUniqueId = homeCommunityId; | ||
var currentDate = LocalDateTime.now().toString(); | ||
|
||
// IMPORTANT: Without the urn prefix we can't replace it later | ||
var documentUuid = "urn:uuid:" + id; | ||
|
@@ -213,24 +215,25 @@ private Document buildDocumentPayload( | |
List.of( | ||
new Author( | ||
null, | ||
"Tester", | ||
"DIGA-Test", | ||
"Oviva Direkt für Adipositas", | ||
"Oviva AG", | ||
"", | ||
"", | ||
"", | ||
"Dr", | ||
// Der identifier in AuthorInstitution muss eine gültige TelematikId sein, so | ||
// wie sie z. B. auf der SMC-B-Karte enthalten ist | ||
List.of(authorInstitution), | ||
List.of("11^^^&1.3.6.1.4.1.19376.3.276.1.5.13&ISO"), | ||
List.of(), | ||
List.of())), | ||
List.of("12^^^&1.3.6.1.4.1.19376.3.276.1.5.13&ISO"), | ||
List.of("25^^^&1.3.6.1.4.1.19376.3.276.1.5.11&ISO"), | ||
List.of("^^Internet^[email protected]"))), | ||
"AVAILABLE", | ||
List.of(ConfidentialityCode.NORMAL.getValue()), | ||
ClassCode.DURCHFUEHRUNGSPROTOKOLL.getValue(), | ||
"DiGA MIO-Beispiel eines Dokument von Referenzimplementierung geschickt (Simple Roundtrip)", | ||
LocalDateTime.now().minusHours(3), | ||
documentUuid, | ||
List.of(EventCode.PATIENTEN_MITGEBRACHT.getValue()), | ||
List.of( | ||
EventCode.VIRTUAL_ENCOUNTER.getValue(), EventCode.PATIENTEN_MITGEBRACHT.getValue()), | ||
FormatCode.DIGA.getValue(), | ||
"", | ||
HealthcareFacilityCode.PATIENT_AUSSERHALB_BETREUUNG.getValue(), | ||
|
@@ -239,13 +242,13 @@ private Document buildDocumentPayload( | |
"application/fhir+xml", | ||
PracticeSettingCode.PATIENT_AUSSERHALB_BETREUUNG.getValue(), | ||
List.of(), | ||
LocalDateTime.now().minusWeeks(2), | ||
LocalDateTime.now().minusWeeks(1), | ||
null, | ||
null, | ||
contents.length, | ||
"Gesundheitsmonitoring", | ||
"ePA Export Oviva Direkt for Obesity " + currentDate, | ||
TypeCode.PATIENTENEIGENE_DOKUMENTE.getValue(), | ||
documentUuid, | ||
"monitoring.xml", | ||
"Oviva_DiGA_Export_" + currentDate, | ||
repositoryUniqueId, | ||
"", | ||
KVNR), | ||
|