Module dbops.push_analysis_jobs

Inserts and updates for ClaimMaker DB tables analysis_jobs and analysis_job_claims

Functions

def db_push(json_result: dict, patient_identifier: str)

Push data extracted for a single patient to a ClaimMaker DB.

Args

json_result : dict
data extracted for a single patient in the Hank AI format. A valid "batch_id" entry, generally set by a prior call to the create_batches function defined in dbops/create_batch.py. If json_result["datasource"] == "database", json_result must also contain a valid "id" entry, and the json_result data will update the job having that id rather than being inserted as a new record.
patient_identifier : str
unique identifier for the patient encounter, typically the source filename.

Returns

bool
True if successful, False otherwise.
def update_job_on_error(job_id: int | str, input_update: dict[str, typing.Any] | None = None) ‑> int

Update the DB after a failed DocuVision extraction.

Set job state to SystemError and append error message to comments. Update input with any new data from the extraction.

Args

job_id : int
the job id.
input_update : dict[str, Any]
new data extracted from the PDF.

Returns

int
the updated job id.