Skip to main content

exceptions

EHR-related exceptions.

Classes​

DataError​

class DataError(*args, **kwargs):

Exception for unexpected data encountered unable to be processed.

Subclasses​

EHRFetchUnsupportedError​

class EHRFetchUnsupportedError(*args, **kwargs):

This backend cannot serve this fetch at all.

The structural half of "no data": not "the fetch failed this time" but "this backend has no way to answer it", which is identical on every run for every patient. Consumers deciding whether a blank is worth retrying — or whether the write guard should count it (steps/ehr_query/functions._every_supported_group_failed) — branch on this type rather than on a capability lookup performed after the fact.

Raised by the backend that knows, at the point it knows: the FHIR R4 client on an unsupported-type OperationOutcome (and the querier when its CapabilityStatement already rules the type out), and the NextGen querier from the endpoints it does not implement. Whether the gap is permanent or merely unimplemented is not encoded here; both are fixed properties of the backend, which is all any consumer needs.

Subclasses GetPatientInfoError so that every handler written for a failed fetch keeps working — the type adds information rather than demanding new handling. A handler that means "could not retrieve this time" has to catch this first and re-raise; the danger is silent, since swallowing it reports a structural gap as a transient one and keeps the guard counting the group for as long as the gap persists.

GetPatientInfoError​

class GetPatientInfoError(*args, **kwargs):

Could not retrieve patient info.

NoMatchingPatientError​

class NoMatchingPatientError(*args, **kwargs):

Exception raised when no patient matching filters is found.

NoPatientIDError​

class NoPatientIDError(*args, **kwargs):

Exception raised when patient ID could not be extracted.

NonSpecificPatientError​

class NonSpecificPatientError(*args, **kwargs):

Exception raised when patient could not be narrowed to a single person.

QuotaExceeded​

class QuotaExceeded(*args, **kwargs):

Exception raised when we have exceeded our API call quota limit.