Guideline Interface

app.main

Guideline Interface - FastAPI interface

FastAPI app

Guideline Interface - FastAPI interface

exception GuidelineException[source]

Bases: Exception

Guideline exception base class

exception GuidelineServerLoginException[source]

Bases: GuidelineException

Guideline server login exception

exception RecommendationNotFoundException[source]

Bases: GuidelineException

Guideline not found exception

class Settings(_env_file='<object object>', _env_file_encoding=None, _env_nested_delimiter=None, _secrets_dir=None, **values)[source]

Bases: BaseSettings

FastAPI Settings for guideline interface

class Config[source]

Bases: object

Config sub class for FastAPI settings

env_file = '.env'
ceosys_base_path: str
magicapp_email: str
magicapp_password: str
magicapp_server: str
magicapp_use: bool
get_file_list(path, pattern)[source]

Returns all files in a paths that match a pattern.

Parameters:
  • path (Union[str, Path]) – Search path

  • pattern (str) – File name pattern

Return type:

List[str]

Returns: List of all files that match the pattern.

get_guideline_recommendation(recommendation_id)[source]

Retrieve a guideline recommendation by its identifier.

Guidelines recommendations are fetched from the MAGICapp server and as a fallback option from local storage.

Parameters:

recommendation_id (int) – Guideline recommendation identifier

Return type:

Dict

Returns: Guideline recommendation in FHIR format

get_guideline_recommendation_from_file(recommendation_id)[source]

Retrieve a guideline recommendation from local storage by its identifier

Parameters:

recommendation_id (int) – Guideline recommendation identifier

Return type:

Dict

Returns: Guideline recommendation in FHIR format

get_guideline_recommendation_from_magicapp(recommendation_id)[source]

Retrieve a guideline recommendation from MAGICapp server (https://app.magicapp.org/) by its identifier.

For the time being, guideline recommendations are saved in the “rational” field of the MAGICapp interface, as currently no specific field for machine-readable versions of the guidelines exists in MAGICapp.

Parameters:

recommendation_id (int) – Guideline recommendation identifier

Return type:

Dict

Returns: Guideline recommendation in FHIR format

async list_guidelines()[source]

Get a list of available guideline recommendations.

Returns: List of available guideline recommendations

Return type:

List[Dict]

async read_guideline(recommendation_id)[source]

Get a specific guideline recommendation

Parameters:

recommendation_id (int) – Guideline recommendation identifier

Return type:

Dict

Returns: Guideline recommendation in FHIR format

async root()[source]

Server greeting.

Returns: Server greeting.

Return type:

Dict