# {{page-title}} (Transaction ERESULT-20) ## General This service a for distributing laboratory results to some predefined Practitioner/Prescriber. ## Input **For Security reason, URL (Base and Query parameter), Authentification mechanism are supplied privately documentation supplied by Agence eSanté to each integrator** A result is sent as a resource of type `Bundle` containing a `DiagnosticReport` as the core entity. `Communication` is used to defined which Practitioner must received the result via eResult service. A full example can be found [here](https://simplifier.net/ePrescriptionLux/8d91c39e-cf80-4323-8c2a-999d9e9e9325/~json). ### The result Bundle The laboratory's software creates a transaction [Bundle](https://simplifier.net/eprescriptionlux/ftbundle): {{tree:https://www.esante.lu/fhir-spec/StructureDefinition/FTBundle}} The `Bundle` is a container to provide all resources (in `Bundle.entry`) that are part of the result, i.e.: - The result envelope which is respresented through a DiagnosticReport - Communication(s) that indicates recipient of this result - Each recipient is described through an Practitioner entity - A PDF document may be included for recipient who benefit from specific document format agreed with laboratory ### The DiagnosticReport - Result envelope A result document is represented by a [DiagnosticReport](https://simplifier.net/eprescriptionlux/ftdiagreport) included in a `Bundle` : {{tree:https://www.esante.lu/fhir-spec/StructureDefinition/FTDiagReport}} Remarks: - Some fields has been given constant value (ie. status, code). - TODO DSP in identifier - presentedForm will contain the XML form and eventually a generic PDF format ### Recipient A recipient must be first described as a Practitioner entity (https://simplifier.net/eprescriptionlux/ftpractitioner) represents a practitioner: {{tree:https://www.esante.lu/fhir-spec/StructureDefinition/FTPractitioner}} A Communication entity referenced previously described Practitioner and the DiagnosticReport (https://simplifier.net/eprescriptionlux/ftcommunication) represents a practitioner: {{tree:https://www.esante.lu/fhir-spec/StructureDefinition/FTCommunication}} In some case, a practitioner may received specific PDF document as a result, in that case the PDF document, a dedicated entry is added to the Bundle. See below. ### Specific PDF Document This specific PDF is described as a [DocumentReference](https://simplifier.net/eprescriptionlux/ftrespdf) entity {{tree:https://www.esante.lu/fhir-spec/StructureDefinition/FTResPDF}} It contains the PDF document encoded as base64 document. ## Output ### Success In case of success, the API will returned: - A HTTP Code 200 - a Bundle with type transaction-response. Each entry of the Bundle contain a 'response' containing itself a: - A status which is "201 Created" - Location (Id of the Created ressource. ie: "Communication/1f148a7e-f9c7-4178-8541-bab379087181/_history/1" - An OperationOutcome indicating that this is successfull Full example can be found [here] (https://simplifier.net/eprescriptionlux/62df724d-d2d1-41f6-a569-27095e41e428) ### Error In case of error, an OperationOutcome will be returned. See {{pagelink:Home/Error-Handling.page.md}} for more information. Main error related to this service are: | HTTP Code | eResult error code | Description | | ------------ | ----------- | ------------- | | 404 | ERESULT_0101 | The prescriber has not registered in eResult - Message "Prescriber not found: urn:oid:1.3.182.4.6|" | | 422 | ERESULT_0301 | One of the Communication in the Bundle is not state "In Progress" | | 422 | ERESULT_0302 | One of the Communication in the Bundle has a received date which is not allowed. | | 422 | HTTP_422 or | The Bundle submitted does not respect FHIR profile described here: {{link:https://www.esante.lu/fhir-spec/StructureDefinition/FTBundle}} - Text in the details node contains more detail |