How documents are returned
Clinical documents (pathology reports, visit notes, discharge summaries, lab reports) reach you as the file the source system stored, wrapped in a FHIR resource that describes it. This page covers where to look for them, what format they arrive in, and how to think about whether you have the "original".
Where documents show up
A document can arrive on either of two resource types. Which one depends on the health system, not on Flexpa, so check both:
The resource itself is metadata: what the document is, its date, who authored or signed it. The document's content is an attachment, which carries the bytes inline (data, base64), points to a Binary (the raw file), or occasionally points to a URL on an external host that Flexpa leaves unchanged. See URL attachments for how to tell these apart and handle external URLs safely.
What format the file is in
Whatever the source system saved. The attachment's contentType tells you which:
application/pdf: a rendered or signed report- C-CDA (an XML clinical document standard, often
application/xmlortext/xml) text/htmlortext/plain- An image such as
image/jpegorimage/tiff, usually a scanned page
The same kind of report can arrive in different formats from different health systems, so branch on contentType rather than assuming a PDF. If you want C-CDA documents converted to structured FHIR resources, see C-CDA to FHIR conversion.
How you download it
When an attachment points to a Binary on the source's FHIR server, Flexpa fetches that file from the source and replaces the URL with a short-lived signed link on binary.flexpa.com. Download it promptly and store the bytes, not the link: the link expires. The DocumentReference page covers fetching, expiry and safe handling of signed links. The same applies to DiagnosticReport.presentedForm.
Is this the original document?
It is the file the source system sent, passed through as received. There is no separate "original" copy held by the issuing hospital or by Flexpa to compare it against, so Flexpa cannot provide a reference file or a reference hash.
If you need an integrity record, compute your own hash when you download:
openssl dgst -sha256 downloaded-report.pdf
Store that hash with the file. It proves the file has not changed since you received it.
Note
Test mode documents are synthetic. The YourChart test patients carry documents that are representative of what a provider connection returns, but no test document can prove how a specific health system formats its reports. If you need a test patient with a particular kind of document, such as a signed pathology report, ask us and we will add one.