athenahealth / apiserver-athenaFlex

Software developers can use sample code and documentation to use athenahealth's athenaPractice/athenaFlow FHIR API Server.
https://mydata.athenahealth.com/home
17 stars 7 forks source link

Document Outbound API #262

Closed satishjayakumar closed 1 year ago

satishjayakumar commented 1 year ago

The requirement is to send the documents, but I do not see any API to post the documents. Please let me know how to achieve this.

I also checked DocumentReference API but it has only read option.

Torin-Shepard-athena commented 1 year ago

@satishjayakumar Please see information in the following issues.

28

62

88

257

satishjayakumar commented 1 year ago

Thank you for the references, It was helpful.

As per our requirement we have some PDF documents like the patient consent documents that has to be sent to athenaPractice and displayed under Chart documents. I would like to know what are the contentType that is supported ?

Document Reference API was success when I sent a Base64 value of the PDF document, but we were not able to Preview this document in the EHR under the chart documents.

    <attachment name="1234">
        <description value="sample document attachment"/>
        <title value="Document-AUTO"/>
        <code value="123" />
        <contentType value="text/xml" />
        <data value="{{BASE64_CDA_DOCUMENT}}"/>
    </attachment>

image

Torin-Shepard-athena commented 1 year ago

Chart document content can be RTF or XML. PDFs can be associated with a Chart document as external attachments as explained in #149 Comment. It makes sense to do this when the PDF file has information related to clinical information in the patient's record.

Patient consent documents can/should be put in athenaPractice as registration attachments.

Sample DocRef Create PPA Request.xml.txt POST this sample request to the DocumentReference endpoint to create a PatientProfileAttachment. Content-Location Response Header will have the URL to read the new DocRef resource by id.

Here is a screenshot of how you can view this PDF attachment in the Registration module. Screenshot Registration Attachment

satishjayakumar commented 1 year ago

Thank you for the info, we are now able to send documents under patient registration.

Since we have some clinical related documents, it would be best for us to send it as a patient chart document. It would be helpful if you could provide a sample request to send a PDF document type as part of DocumentReference API.

Note : r4_mappings.properties file has this -DOCUMENTREFERENCE_EXTERNAL_EXTENSION.WHITELIST=jpg,gif,txt,pdf,png,xml

Torin-Shepard-athena commented 1 year ago

DocumentReference create API supports creating external attachments/references linked to Chart documents. With this workflow, the description and URL value are stored as an external file attachment linked to the Chart document.

IMPORTANT: The athenaPractice/athenaFlow client applications will need to have access to the file path written by the DocRef POST request. The FHIR Server validates only the presence of content.attachment.url element. It cannot validate the value will be accessible by the athenaPractice/athenaFlow client application.

Sample DocRef POST request body to create Chart document with PDF as an external attachment.

Here is a screenshot of the external attachment to the newly created Chart document in athenaPractice client application. Screenshot Chart External Attachment Created by FHIR DocRef POST

AjeetYadav07 commented 1 year ago

@satishjayakumar, Hoping we have answered your questions asked in this thread. Marking this issue as closed.