The single definition of "the rendered text of this chart".
Priority order:
An emr_document with a type and a body renders through EMRDocumentFormatter. When its parsed
content was rendered by an extraction, that body follows the formatter's header.
An Extend patient_chart upload renders through renderExtendChartFields — its structured
extraction, NOT the OCR of the print, which is a single half-million-character blob we have no
honest way to cut up. An upload that does not parse as an Extend payload still renders its
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. When its parsed content was rendered by an extraction, that body follows the formatter's header.patient_chartupload renders throughrenderExtendChartFields— its structured extraction, NOT the OCR of the print, which is a single half-million-character blob we have no honest way to cut up. An upload that does not parse as an Extend payload still renders itsnotes/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.