R2: Rechnung validieren/einreichen (Bulk)

Die nachfolgende Interaktion ist relevant für den FD als Server, sowie für das RE-PS als Client. Anwendungsfall AF_10136 MUSS durch den FD über die spezifizierte API umgesetzt werden. Die Vorgaben aus "Tabelle 15: Use Case Rechnung mit Dokumenten validieren und versenden" des Feature-Dokumentes MÜSSEN eingehalten werden durch den FD.

HTTP-Methode POST
Endpunkt / (Root-Endpunkt)

Für die Ausführung der Operation gelten die gleichen Vorgaben wie aus R1: Rechnung mit Dokumenten validieren und versenden. Die Operation $invoice-submit kann für innerhalb eines Batch-Bundles mehrfach, auch für unterschiedliche Dokumente aufgerufen werden. Es gelten die entsprechenden Vorgaben aus der FHIR-Kernspezifikation.

Asynchrone Verarbeitung

Diese Interaktion ist aufgrund potenziell großer Datenmengen asynchron vom FD auszuführen. Dies MUSS der Client mittels eines Prefer: respond-async-Headers nach RFC7240 dem FD signalisieren.

API-Zustand HTTP-Status-Code
Erfolgsfall 202 - Accepted
Eine DocumentReferenz mit dem selben Identifier extistiert bereits 200 - OK In diesem Fall wird der ursprüngliche Response mit Rechnungs-Token erneut zurück gegeben
Weitere Parameter in HTTP-Anfrage enthalten 400 - Bad Request
Syntax für Parameter ist nicht korrekt oder Kardinalitäten werden nicht eingehalten 400 - Bad Request
Kein valides Access-Token wird mitgesendet 401 - Unauthorized
Autorisierter Benutzer verfügt über keine ausreichende Berechtigung die Interaktion auszuführen 403 - Forbidden
Andere HTTP-Methode wird verwendet 405 - Method Not Allowed

In einem Location-Header MUSS der FD dem RE-PS eine absolute URL mitteilen unter welcher das RE-PS per Polling prüfen kann, ob die Interaktion abgeschlossen wurde und entsprechende Rückgabewerte seitens der $retrieve-Operation vorliegen. Der Aufbau der Location-URL MUSS aus kryptografisch zufälligen Teilen bestehen, sodass der Aufbau nicht deterministisch ermittelt oder erraten werden kann. Der Server SOLLTE RE-PS-Clients mit einem HTTP-Status-Code 429 Too Many Requests abweisen, falls nach dem Ermessen des FDs die Location-URL zu häufig geprüft wird. Der FD SOLLTE einen Retry-After-Header entsprechend den Vorgaben aus der FHIR-Kernspezifikation verwenden.

Nach der Verarbeitung des batch-Bundles MUSS der FD das batch-response-Bundle unter der Location-URL bereitstellen, welches die Ergebnisse entsprechnd der Verarbeitung der einzelnen Dokumente nach AF_10271 enthält. Es ist zu beachten, dass der FD die Autorisierung für jedes Dokument gemäß den Vorgaben zu AF_10271 individuell prüfen MUSS. Der FD MUSS sicherstellen, dass das batch-response-Bundle nur einem validen Access-Token abgerufen werden kann.

Sollte die Location-URL unvorhergesehen nicht durch den RE-PS abfragbar sein (Systemausfall oder andere Fehler), kann das batch-Bundles erneut versendet werden. Bereits beim ersten Versand erfolgreich verarbeitete Daten werden in dem Fall mit 200 - OK bestätigt und die ursprüngliche Response wird zurückgegeben. Es kommt folglich nicht zu Dubletten. Der Abgleich erfolgt auf Basis des DocumentReference.identifier, welcher nur einmalig im FD vorkommen darf. Es wird ein Rate-Limit für die Bulk Schnittstelle geben.

Beispiel

HTTP POST [fachdienst-endpunkt]/
Bundle
<Bundle xmlns="http://hl7.org/fhir">
<id value="BulkSubmitExample" />
<type value="batch" />
<Parameters>
<id value="BeispielParameterSubmitInput3-LE" />
<name value="rechnung" />
<DocumentReference>
<id value="BeispielDocumentReferenceRechnung3-LE" />
<extension url="http://example.org/StructureDefinition/signatur">
<system value="urn:iso-astm:E1762-95:2013" />
<code value="1.2.840.10065.1.12.1.1" />
<display value="Author's Signature" />
</type>
<when value="2015-02-07T13:28:17.239+02:00" />
<who>
<display value="Arzt" />
</who>
</valueSignature>
</extension>
<status value="current" />
<system value="http://dvmd.de/fhir/CodeSystem/kdl" />
<code value="AM010106" />
<display value="Rechnung ambulante/stationäre Behandlung" />
</coding>
</type>
<system value="http://fhir.de/sid/gkv/kvid-10" />
<value value="A000000000" />
</identifier>
</subject>
<description value="Rechnung Reiseimpfung vom 10.01.2024" />
<contentType value="application/pdf" />
<data value="DIESISTNUREINBEISPIELDIESISTKEINVALIDESPDF00" />
</attachment>
</content>
<contentType value="application/xml" />
<data value="DIESISTNUREINBEISPIELDIESISTKEINVALIDESXML00" />
</attachment>
<code value="xrechnung" />
</format>
</content>
<contentType value="application/fhir+xml" />
<data value="DIESISTNUREINBEISPIELDIESISTKEINVALIDESXML00" />
</attachment>
<code value="gematik-dipag" />
</format>
</content>
</DocumentReference>
</resource>
</parameter>
<name value="anhang" />
<DocumentReference>
<id value="BeispielDocumentReferenceSonstigesDokument3-LE" />
<status value="current" />
<system value="http://dvmd.de/fhir/CodeSystem/kdl" />
<code value="PT130102" />
<display value="Molekularpathologiebefund" />
</coding>
</type>
<reference value="Patient/BeispielPatient3-FD" />
</subject>
<description value="Molekularpathologiebefund vom 31.12.21" />
<contentType value="application/pdf" />
<data value="DIESISTNUREINBEISPIELDIESISTKEINVALIDESPDF00" />
</attachment>
</content>
</DocumentReference>
</resource>
</parameter>
</Parameters>
</resource>
<method value="POST" />
<url value="/Patient/BeispielPatient3-FD/$invoice-submit" />
</request>
</entry>
<Parameters>
<id value="BeispielParameterSubmitInput3.1-LE" />
<name value="rechnung" />
<DocumentReference>
<id value="BeispielDocumentReferenceRechnung3.1-LE" />
<extension url="http://example.org/StructureDefinition/signatur">
<system value="urn:iso-astm:E1762-95:2013" />
<code value="1.2.840.10065.1.12.1.1" />
<display value="Author's Signature" />
</type>
<when value="2015-02-07T13:29:17.239+02:00" />
<who>
<display value="Arzt" />
</who>
</valueSignature>
</extension>
<status value="current" />
<system value="http://dvmd.de/fhir/CodeSystem/kdl" />
<code value="AM010106" />
<display value="Rechnung ambulante/stationäre Behandlung" />
</coding>
</type>
<system value="http://fhir.de/sid/gkv/kvid-10" />
<value value="A000000000" />
</identifier>
</subject>
<description value="Rechnung Reiseimpfung vom 10.01.2024" />
<contentType value="application/pdf" />
<data value="DIESISTNUREINBEISPIELDIESISTKEINVALIDESPDF00" />
</attachment>
</content>
<contentType value="application/xml" />
<data value="DIESISTNUREINBEISPIELDIESISTKEINVALIDESXML00" />
</attachment>
<code value="xrechnung" />
</format>
</content>
<contentType value="application/fhir+xml" />
<data value="DIESISTNUREINBEISPIELDIESISTKEINVALIDESXML00" />
</attachment>
<code value="gematik-dipag" />
</format>
</content>
</DocumentReference>
</resource>
</parameter>
<name value="anhang" />
<DocumentReference>
<id value="BeispielDocumentReferenceSonstigesDokument3.1-LE" />
<status value="current" />
<system value="http://dvmd.de/fhir/CodeSystem/kdl" />
<code value="PT130102" />
<display value="Molekularpathologiebefund" />
</coding>
</type>
<reference value="Patient/BeispielPatient3-FD" />
</subject>
<description value="Molekularpathologiebefund vom 30.12.21" />
<contentType value="application/pdf" />
<data value="DIESISTNUREINBEISPIELDIESISTKEINVALIDESPDF00" />
</attachment>
</content>
</DocumentReference>
</resource>
</parameter>
</Parameters>
</resource>
<method value="POST" />
<url value="/Patient/BeispielPatient3-FD/$invoice-submit" />
</request>
</entry>
</Bundle>
{
"resourceType": "Bundle",
"id": "BulkSubmitExample",
"type": "batch",
"entry": [
{
"request": {
"method": "POST",
"url": "/Patient/BeispielPatient3-FD/$invoice-submit"
},
"resourceType": "Parameters",
"id": "BeispielParameterSubmitInput3-LE",
{
"name": "rechnung",
"resourceType": "DocumentReference",
"id": "BeispielDocumentReferenceRechnung3-LE",
"status": "current",
"type": {
"coding": [
{
"code": "AM010106",
"system": "http://dvmd.de/fhir/CodeSystem/kdl",
"display": "Rechnung ambulante/stationäre Behandlung"
}
]
},
"description": "Rechnung Reiseimpfung vom 10.01.2024",
"subject": {
"system": "http://fhir.de/sid/gkv/kvid-10",
"value": "A000000000"
}
},
"content": [
{
"contentType": "application/pdf",
"data": "DIESISTNUREINBEISPIELDIESISTKEINVALIDESPDF00"
}
},
{
"format": {
"code": "xrechnung"
},
"contentType": "application/xml",
"data": "DIESISTNUREINBEISPIELDIESISTKEINVALIDESXML00"
}
},
{
"format": {
"code": "gematik-dipag"
},
"contentType": "application/fhir+xml",
"data": "DIESISTNUREINBEISPIELDIESISTKEINVALIDESXML00"
}
}
],
{
"url": "http://example.org/StructureDefinition/signatur",
"type": [
{
"code": "1.2.840.10065.1.12.1.1",
"system": "urn:iso-astm:E1762-95:2013",
"display": "Author's Signature"
}
],
"when": "2015-02-07T13:28:17.239+02:00",
"who": {
"display": "Arzt"
}
}
}
]
}
},
{
"name": "anhang",
"resourceType": "DocumentReference",
"id": "BeispielDocumentReferenceSonstigesDokument3-LE",
"status": "current",
"type": {
"coding": [
{
"code": "PT130102",
"system": "http://dvmd.de/fhir/CodeSystem/kdl",
"display": "Molekularpathologiebefund"
}
]
},
"description": "Molekularpathologiebefund vom 31.12.21",
"subject": {
"reference": "Patient/BeispielPatient3-FD"
},
"content": [
{
"contentType": "application/pdf",
"data": "DIESISTNUREINBEISPIELDIESISTKEINVALIDESPDF00"
}
}
]
}
}
]
}
},
{
"request": {
"method": "POST",
"url": "/Patient/BeispielPatient3-FD/$invoice-submit"
},
"resourceType": "Parameters",
"id": "BeispielParameterSubmitInput3.1-LE",
{
"name": "rechnung",
"resourceType": "DocumentReference",
"id": "BeispielDocumentReferenceRechnung3.1-LE",
"status": "current",
"type": {
"coding": [
{
"code": "AM010106",
"system": "http://dvmd.de/fhir/CodeSystem/kdl",
"display": "Rechnung ambulante/stationäre Behandlung"
}
]
},
"description": "Rechnung Reiseimpfung vom 10.01.2024",
"subject": {
"system": "http://fhir.de/sid/gkv/kvid-10",
"value": "A000000000"
}
},
"content": [
{
"contentType": "application/pdf",
"data": "DIESISTNUREINBEISPIELDIESISTKEINVALIDESPDF00"
}
},
{
"format": {
"code": "xrechnung"
},
"contentType": "application/xml",
"data": "DIESISTNUREINBEISPIELDIESISTKEINVALIDESXML00"
}
},
{
"format": {
"code": "gematik-dipag"
},
"contentType": "application/fhir+xml",
"data": "DIESISTNUREINBEISPIELDIESISTKEINVALIDESXML00"
}
}
],
{
"url": "http://example.org/StructureDefinition/signatur",
"type": [
{
"code": "1.2.840.10065.1.12.1.1",
"system": "urn:iso-astm:E1762-95:2013",
"display": "Author's Signature"
}
],
"when": "2015-02-07T13:29:17.239+02:00",
"who": {
"display": "Arzt"
}
}
}
]
}
},
{
"name": "anhang",
"resourceType": "DocumentReference",
"id": "BeispielDocumentReferenceSonstigesDokument3.1-LE",
"status": "current",
"type": {
"coding": [
{
"code": "PT130102",
"system": "http://dvmd.de/fhir/CodeSystem/kdl",
"display": "Molekularpathologiebefund"
}
]
},
"description": "Molekularpathologiebefund vom 30.12.21",
"subject": {
"reference": "Patient/BeispielPatient3-FD"
},
"content": [
{
"contentType": "application/pdf",
"data": "DIESISTNUREINBEISPIELDIESISTKEINVALIDESPDF00"
}
}
]
}
}
]
}
}
]
}

Antwort des Fachdienstes nach der Verarbeitung des batch-Bundles:

HTTP 200 OK

mit Body:

Bundle
<Bundle xmlns="http://hl7.org/fhir">
<id value="BulkSubmitExampleOutput" />
<type value="batch-response" />
<fullUrl value="[FD-endpunkt]/Parameters/BeispielParameterSubmitOutput3-FD" />
<Parameters>
<id value="BeispielParameterSubmitOutput3-FD" />
<name value="rechnung" />
<DocumentReference>
<id value="BeispielDocumentReferenceRechnung3-FD" />
<system value="https://gematik.de/fhir/sid/dipag-token" />
<value value="123-456-789" />
</identifier>
<status value="current" />
<system value="http://dvmd.de/fhir/CodeSystem/kdl" />
<code value="AM010106" />
<display value="Rechnung ambulante/stationäre Behandlung" />
</coding>
</type>
<system value="http://fhir.de/sid/gkv/kvid-10" />
<value value="A000000000" />
</identifier>
</subject>
<code value="transforms" />
<reference value="DocumentReference/BeispielDocumentReferenceRechnung3-LE" />
</target>
</relatesTo>
<description value="Rechnung Reiseimpfung vom 10.01.2024" />
<contentType value="application/pdf" />
<url value="[FD-endpunkt]/Binary/pdf-mit-token-barcode" />
</attachment>
</content>
<contentType value="application/xml" />
<url value="[FD-endpunkt]/Binary/xrechnung" />
</attachment>
<code value="xrechnung" />
</format>
</content>
<contentType value="application/fhir+xml" />
<url value="[FD-endpunkt]/Binary/invoice" />
</attachment>
<code value="dipag" />
</format>
</content>
</DocumentReference>
</resource>
</parameter>
<name value="anhang" />
<DocumentReference>
<id value="BeispielDocumentReferenceSonstigesDokument3-FD" />
<system value="https://gematik.de/fhir/sid/dipag-token" />
<value value="987-654-321" />
</identifier>
<status value="current" />
<system value="http://dvmd.de/fhir/CodeSystem/kdl" />
<code value="PT130102" />
<display value="Molekularpathologiebefund" />
</coding>
</type>
<reference value="Patient/BeispielPatient3-FD" />
</subject>
<code value="transforms" />
<reference value="DocumentReference/BeispielDocumentReferenceSonstigesDokument3-LE" />
</target>
</relatesTo>
<description value="Molekularpathologiebefund vom 31.12.21" />
<contentType value="application/pdf" />
<url value="[FD-endpunkt]/Binary/patho-mit-token-barcode" />
</attachment>
</content>
</DocumentReference>
</resource>
</parameter>
</Parameters>
</resource>
</entry>
<fullUrl value="[FD-endpunkt]/Parameters/BeispielParameterSubmitOutput3.1-FD" />
<Parameters>
<id value="BeispielParameterSubmitOutput3.1-FD" />
<name value="rechnung" />
<DocumentReference>
<id value="BeispielDocumentReferenceRechnung3.1-FD" />
<system value="https://gematik.de/fhir/sid/dipag-token" />
<value value="123-456-987" />
</identifier>
<status value="current" />
<system value="http://dvmd.de/fhir/CodeSystem/kdl" />
<code value="AM010106" />
<display value="Rechnung ambulante/stationäre Behandlung" />
</coding>
</type>
<system value="http://fhir.de/sid/gkv/kvid-10" />
<value value="A000000000" />
</identifier>
</subject>
<code value="transforms" />
<reference value="DocumentReference/BeispielDocumentReferenceRechnung3-LE" />
</target>
</relatesTo>
<description value="Rechnung Reiseimpfung vom 10.01.2024" />
<contentType value="application/pdf" />
<url value="[FD-endpunkt]/Binary/pdf-mit-token-barcode" />
</attachment>
</content>
<contentType value="application/xml" />
<url value="[FD-endpunkt]/Binary/xrechnung" />
</attachment>
<code value="xrechnung" />
</format>
</content>
<contentType value="application/fhir+xml" />
<url value="[FD-endpunkt]/Binary/invoice" />
</attachment>
<code value="gematik-dipag" />
</format>
</content>
</DocumentReference>
</resource>
</parameter>
<name value="anhang" />
<DocumentReference>
<id value="BeispielDocumentReferenceSonstigesDokument3.1-FD" />
<system value="https://gematik.de/fhir/sid/dipag-token" />
<value value="987-654-321" />
</identifier>
<status value="current" />
<system value="http://dvmd.de/fhir/CodeSystem/kdl" />
<code value="PT130102" />
<display value="Molekularpathologiebefund" />
</coding>
</type>
<reference value="Patient/BeispielPatient3-FD" />
</subject>
<code value="transforms" />
<reference value="DocumentReference/BeispielDocumentReferenceSonstigesDokument3-LE" />
</target>
</relatesTo>
<description value="Molekularpathologiebefund vom 31.12.21" />
<contentType value="application/pdf" />
<url value="[FD-endpunkt]/Binary/patho-mit-token-barcode" />
</attachment>
</content>
</DocumentReference>
</resource>
</parameter>
</Parameters>
</resource>
</entry>
</Bundle>
{
"resourceType": "Bundle",
"id": "BulkSubmitExampleOutput",
"type": "batch-response",
"entry": [
{
"fullUrl": "[FD-endpunkt]/Parameters/BeispielParameterSubmitOutput3-FD",
"resourceType": "Parameters",
"id": "BeispielParameterSubmitOutput3-FD",
{
"name": "rechnung",
"resourceType": "DocumentReference",
"id": "BeispielDocumentReferenceRechnung3-FD",
{
"system": "https://gematik.de/fhir/sid/dipag-token",
"value": "123-456-789"
}
],
"status": "current",
"type": {
"coding": [
{
"code": "AM010106",
"system": "http://dvmd.de/fhir/CodeSystem/kdl",
"display": "Rechnung ambulante/stationäre Behandlung"
}
]
},
"description": "Rechnung Reiseimpfung vom 10.01.2024",
"subject": {
"system": "http://fhir.de/sid/gkv/kvid-10",
"value": "A000000000"
}
},
"content": [
{
"contentType": "application/pdf",
"url": "[FD-endpunkt]/Binary/pdf-mit-token-barcode"
}
},
{
"format": {
"code": "xrechnung"
},
"contentType": "application/xml",
"url": "[FD-endpunkt]/Binary/xrechnung"
}
},
{
"format": {
"code": "dipag"
},
"contentType": "application/fhir+xml",
"url": "[FD-endpunkt]/Binary/invoice"
}
}
],
{
"code": "transforms",
"target": {
"reference": "DocumentReference/BeispielDocumentReferenceRechnung3-LE"
}
}
]
}
},
{
"name": "anhang",
"resourceType": "DocumentReference",
"id": "BeispielDocumentReferenceSonstigesDokument3-FD",
{
"system": "https://gematik.de/fhir/sid/dipag-token",
"value": "987-654-321"
}
],
"status": "current",
"type": {
"coding": [
{
"code": "PT130102",
"system": "http://dvmd.de/fhir/CodeSystem/kdl",
"display": "Molekularpathologiebefund"
}
]
},
"description": "Molekularpathologiebefund vom 31.12.21",
"subject": {
"reference": "Patient/BeispielPatient3-FD"
},
"content": [
{
"contentType": "application/pdf",
"url": "[FD-endpunkt]/Binary/patho-mit-token-barcode"
}
}
],
{
"code": "transforms",
"target": {
"reference": "DocumentReference/BeispielDocumentReferenceSonstigesDokument3-LE"
}
}
]
}
}
]
}
},
{
"fullUrl": "[FD-endpunkt]/Parameters/BeispielParameterSubmitOutput3.1-FD",
"resourceType": "Parameters",
"id": "BeispielParameterSubmitOutput3.1-FD",
{
"name": "rechnung",
"resourceType": "DocumentReference",
"id": "BeispielDocumentReferenceRechnung3.1-FD",
{
"system": "https://gematik.de/fhir/sid/dipag-token",
"value": "123-456-987"
}
],
"status": "current",
"type": {
"coding": [
{
"code": "AM010106",
"system": "http://dvmd.de/fhir/CodeSystem/kdl",
"display": "Rechnung ambulante/stationäre Behandlung"
}
]
},
"description": "Rechnung Reiseimpfung vom 10.01.2024",
"subject": {
"system": "http://fhir.de/sid/gkv/kvid-10",
"value": "A000000000"
}
},
"content": [
{
"contentType": "application/pdf",
"url": "[FD-endpunkt]/Binary/pdf-mit-token-barcode"
}
},
{
"format": {
"code": "xrechnung"
},
"contentType": "application/xml",
"url": "[FD-endpunkt]/Binary/xrechnung"
}
},
{
"format": {
"code": "gematik-dipag"
},
"contentType": "application/fhir+xml",
"url": "[FD-endpunkt]/Binary/invoice"
}
}
],
{
"code": "transforms",
"target": {
"reference": "DocumentReference/BeispielDocumentReferenceRechnung3-LE"
}
}
]
}
},
{
"name": "anhang",
"resourceType": "DocumentReference",
"id": "BeispielDocumentReferenceSonstigesDokument3.1-FD",
{
"system": "https://gematik.de/fhir/sid/dipag-token",
"value": "987-654-321"
}
],
"status": "current",
"type": {
"coding": [
{
"code": "PT130102",
"system": "http://dvmd.de/fhir/CodeSystem/kdl",
"display": "Molekularpathologiebefund"
}
]
},
"description": "Molekularpathologiebefund vom 31.12.21",
"subject": {
"reference": "Patient/BeispielPatient3-FD"
},
"content": [
{
"contentType": "application/pdf",
"url": "[FD-endpunkt]/Binary/patho-mit-token-barcode"
}
}
],
{
"code": "transforms",
"target": {
"reference": "DocumentReference/BeispielDocumentReferenceSonstigesDokument3-LE"
}
}
]
}
}
]
}
}
]
}