The single definition of "the rendered text of this chart".
Priority order:
An emr_document with a type and a body renders through EMRDocumentFormatter.
A patient_chart upload renders its extracted notes/fields as JSON.
Anything left over falls back to raw_document.__circle_parsed_content.parsed_text.
Otherwise there is no text.
Parsed content is a fallback rather than the first choice on purpose. For an EMR document it is
a snapshot of this formatter's output taken when the document was embedded, so preferring it
would serve stale text whenever a formatter changes. It earns its place covering the cases the
formatter cannot: uploads whose text was extracted from a PDF, and document types the formatter
throws on.
Never throws — EMRDocumentFormatter.format throws on unsupported types and on malformed
bodies, and one unrenderable document must not fail a whole batch.
The single definition of "the rendered text of this chart".
Priority order:
emr_documentwith a type and a body renders throughEMRDocumentFormatter.patient_chartupload renders its extractednotes/fieldsas JSON.raw_document.__circle_parsed_content.parsed_text.Parsed content is a fallback rather than the first choice on purpose. For an EMR document it is a snapshot of this formatter's output taken when the document was embedded, so preferring it would serve stale text whenever a formatter changes. It earns its place covering the cases the formatter cannot: uploads whose text was extracted from a PDF, and document types the formatter throws on.
Never throws —
EMRDocumentFormatter.formatthrows on unsupported types and on malformed bodies, and one unrenderable document must not fail a whole batch.