Package Gnumed :: Package business :: Module gmClinicalRecord :: Class cClinicalRecord |
[frames] | no frames]

# Class cClinicalRecord

source code

    object --+
             |
            cClinicalRecord

Instance Methods
__init__(self, aPKey=None, allow_user_interaction=True) Fails if | source code
__del__(self) | source code
cleanup(self) | source code
db_callback_encounter_mod_db(self, **kwds) | source code
db_callback_vaccs_modified(self, **kwds) | source code
get_family_history(self, episodes=None, issues=None, encounters=None) | source code
add_family_history(self, episode=None, condition=None, relation=None) | source code
get_performed_procedures(self, episodes=None, issues=None) | source code
get_latest_performed_procedure(self) | source code
add_performed_procedure(self, episode=None, location=None, hospital_stay=None, procedure=None) | source code
get_hospital_stays(self, episodes=None, issues=None, ongoing_only=False) | source code
get_latest_hospital_stay(self) | source code
add_hospital_stay(self, episode=None) | source code
get_hospital_stay_stats_by_hospital(self, cover_period=None) | source code
add_notes(self, notes=None, episode=None, encounter=None) | source code
add_clin_narrative(self, note='', soap_cat='s', episode=None) | source code
get_clin_narrative(self, since=None, until=None, encounters=None, episodes=None, issues=None, soap_cats=None, providers=None) Get SOAP notes pertinent to this encounter. | source code
get_as_journal(self, since=None, until=None, encounters=None, episodes=None, issues=None, soap_cats=None, providers=None, order_by=None, time_range=None) | source code
search_narrative_simple(self, search_term='') | source code
get_text_dump_old(self) | source code
get_text_dump(self, since=None, until=None, encounters=None, episodes=None, issues=None) | source code
get_patient_ID(self) | source code
get_statistics(self) | source code
format_statistics(self) | source code
format_summary(self, dob=None) | source code
format_as_journal(self, left_margin=0, patient=None) | source code
get_allergies(self, remove_sensitivities=False, since=None, until=None, encounters=None, episodes=None, issues=None, ID_list=None) Retrieves patient allergy items. | source code
add_allergy(self, allergene=None, allg_type=None, encounter_id=None, episode_id=None) | source code
delete_allergy(self, pk_allergy=None) | source code
is_allergic_to(self, atcs=None, inns=None, brand=None) Cave: only use with one potential allergic agent otherwise you won't know which of the agents the allergy is to. | source code
get_episodes(self, id_list=None, issues=None, open_status=None, order_by=None, unlinked_only=False) Fetches from backend patient episodes. | source code
get_unlinked_episodes(self, open_status=None, order_by=None) | source code
get_episodes_by_encounter(self, pk_encounter=None) | source code
add_episode(self, episode_name=None, pk_health_issue=None, is_open=False) Add episode 'episode_name' for a patient's health issue. | source code
get_most_recent_episode(self, issue=None) | source code
episode2problem(self, episode=None) | source code
get_problems(self, episodes=None, issues=None, include_closed_episodes=False, include_irrelevant_issues=False) Retrieve a patient's problems. | source code
problem2episode(self, problem=None) | source code
problem2issue(self, problem=None) | source code
reclass_problem(self, problem) | source code
get_health_issues(self, id_list=None) | source code
add_health_issue(self, issue_name=None) Adds patient health issue. | source code
health_issue2problem(self, issue=None) | source code
get_current_substance_intakes(self, include_inactive=True, include_unapproved=False, order_by=None, episodes=None, issues=None) | source code
add_substance_intake(self, pk_substance=None, pk_component=None, episode=None, preparation=None) | source code
substance_intake_exists(self, pk_component=None, pk_substance=None) | source code
add_vaccination(self, episode=None, vaccine=None, batch_no=None) | source code
get_latest_vaccinations(self, episodes=None, issues=None) Returns latest given vaccination for each vaccinated indication. | source code
get_vaccinations(self, order_by=None, episodes=None, issues=None, encounters=None) | source code
get_scheduled_vaccination_regimes(self, ID=None, indications=None) Retrieves vaccination regimes the patient is on. | source code
get_vaccinations_old(self, ID=None, indications=None, since=None, until=None, encounters=None, episodes=None, issues=None) Retrieves list of vaccinations the patient has received. | source code
get_scheduled_vaccinations(self, indications=None) Retrieves vaccinations scheduled for a regime a patient is on. | source code
get_missing_vaccinations(self, indications=None) | source code
start_new_encounter(self) | source code
get_encounters(self, since=None, until=None, id_list=None, episodes=None, issues=None, skip_empty=False) Retrieves patient's encounters. | source code
get_first_encounter(self, issue_id=None, episode_id=None) Retrieves first encounter for a particular issue and/or episode. | source code
get_earliest_care_date(self) | source code
get_last_encounter(self, issue_id=None, episode_id=None) Retrieves last encounter for a concrete issue and/or episode | source code
get_encounter_stats_by_type(self, cover_period=None) | source code
get_last_but_one_encounter(self, issue_id=None, episode_id=None) | source code
remove_empty_encounters(self) | source code
get_most_recent_results(self, test_type=None, loinc=None, no_of_results=1) | source code
get_result_at_timestamp(self, timestamp=None, test_type=None, loinc=None, tolerance_interval='12 hours') | source code
get_unsigned_results(self, order_by=None) | source code
get_test_types_for_results(self) Retrieve data about test types for which this patient has results. | source code
get_dates_for_results(self, tests=None, reverse_chronological=True) Get the dates for which we have results. | source code
get_test_results(self, encounters=None, episodes=None, tests=None, order_by=None) | source code
get_test_results_by_date(self, encounter=None, episodes=None, tests=None, reverse_chronological=True) | source code
add_test_result(self, episode=None, type=None, intended_reviewer=None, val_num=None, val_alpha=None, unit=None) | source code
get_lab_request(self, pk=None, req_id=None, lab=None) | source code
add_lab_request(self, lab=None, req_id=None, encounter_id=None, episode_id=None) | source code
Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Class Variables
| performed_procedures = `property(get_performed_procedures, lamb`...``
| hospital_stays = `property(get_hospital_stays, lambda x: x)`
| allergy_state = `property(_get_allergy_state, _set_allergy_state)`
| episodes = `property(get_episodes, lambda x: x)`
| unlinked_episodes = `property(get_unlinked_episodes, lambda x: x)`
| health_issues = `property(get_health_issues, lambda x: x)`
| vaccinations = `property(get_vaccinations, lambda x: x)`
| current_encounter = `property(_get_current_encounter, _set_curr`...``
| active_encounter = `property(_get_current_encounter, _set_curre`...``
| earliest_care_date = `property(get_earliest_care_date, lambda x`...``
| last_encounter = `property(get_last_encounter, lambda x: x)`

Properties
Inherited from `object`: `__class__`

Method Details

### __init__(self, aPKey=None, allow_user_interaction=True) (Constructor) | source code
    Fails if

    - no connection to database possible
    - patient referenced by aPKey does not exist
Overrides: object.__init__

### get_clin_narrative(self, since=None, until=None, encounters=None, episodes=None, issues=None, soap_cats=None, providers=None) | source code
Get SOAP notes pertinent to this encounter. since initial date for narrative items until final date for narrative items encounters list of encounters whose narrative are to be retrieved episodes list of episodes whose narrative are to be retrieved issues list of health issues whose narrative are to be retrieved soap_cats list of SOAP categories of the narrative to be retrieved

### get_allergies(self, remove_sensitivities=False, since=None, until=None, encounters=None, episodes=None, issues=None, ID_list=None) | source code
Retrieves patient allergy items. remove_sensitivities retrieve real allergies only, without sensitivities since initial date for allergy items until final date for allergy items encounters list of encounters whose allergies are to be retrieved episodes list of episodes whose allergies are to be retrieved issues list of health issues whose allergies are to be retrieved

### get_episodes(self, id_list=None, issues=None, open_status=None, order_by=None, unlinked_only=False) | source code
Fetches from backend patient episodes. id_list - Episodes' PKs list issues - Health issues' PKs list to filter episodes by open_status - return all (None) episodes, only open (True) or closed (False) one(s)

### add_episode(self, episode_name=None, pk_health_issue=None, is_open=False) | source code
    Add episode 'episode_name' for a patient's health issue.

    - silently returns if episode already exists

### get_problems(self, episodes=None, issues=None, include_closed_episodes=False, include_irrelevant_issues=False) | source code
Retrieve a patient's problems. "Problems" are the UNION of: issues which are .clinically_relevant episodes which are .is_open Therefore, both an issue and the open episode thereof can each be listed as a problem. include_closed_episodes/include_irrelevant_issues will include those -- which departs from the definition of the problem list being "active" items only ... episodes - episodes' PKs to filter problems by issues - health issues' PKs to filter problems by

### get_latest_vaccinations(self, episodes=None, issues=None) | source code
Returns latest given vaccination for each vaccinated indication. as a dict {'l10n_indication': cVaccination instance} Note that this will produce duplicate vaccination instances on combi-indication vaccines !

### get_scheduled_vaccination_regimes(self, ID=None, indications=None) | source code
    Retrieves vaccination regimes the patient is on.

    optional:
    * ID - PK of the vaccination regime
    * indications - indications we want to retrieve vaccination
            regimes for, must be primary language, not l10n_indication

### get_vaccinations_old(self, ID=None, indications=None, since=None, until=None, encounters=None, episodes=None, issues=None) | source code
    Retrieves list of vaccinations the patient has received.

            optional:
            * ID - PK of a vaccination
            * indications - indications we want to retrieve vaccination
                    items for, must be primary language, not l10n_indication
    * since - initial date for allergy items
    * until - final date for allergy items
    * encounters - list of encounters whose allergies are to be retrieved
    * episodes - list of episodes whose allergies are to be retrieved
    * issues - list of health issues whose allergies are to be retrieved

### get_scheduled_vaccinations(self, indications=None) | source code
    Retrieves vaccinations scheduled for a regime a patient is on.

    The regime is referenced by its indication (not l10n)

    * indications - List of indications (not l10n) of regimes we want scheduled
                    vaccinations to be fetched for

### get_encounters(self, since=None, until=None, id_list=None, episodes=None, issues=None, skip_empty=False) | source code
Retrieves patient's encounters. id_list - PKs of encounters to fetch since - initial date for encounter items, DateTime instance until - final date for encounter items, DateTime instance episodes - PKs of the episodes the encounters belong to (many-to-many relation) issues - PKs of the health issues the encounters belong to (many-to-many relation) skip_empty - do NOT return those which do not have any of documents/clinical items/RFE/AOE NOTE: if you specify *both* issues and episodes you will get the *aggregate* of all encounters even if the episodes all belong to the health issues listed. IOW, the issues broaden the episode list rather than the episode list narrowing the episodes-from-issues list. Rationale: If it was the other way round it would be redundant to specify the list of issues at all.

### get_first_encounter(self, issue_id=None, episode_id=None) | source code
Retrieves first encounter for a particular issue and/or episode. issue_id - First encounter associated health issue episode - First encounter associated episode

### get_last_encounter(self, issue_id=None, episode_id=None) | source code
Retrieves last encounter for a concrete issue and/or episode issue_id - Last encounter associated health issue episode_id - Last encounter associated episode

Class Variable Details

  ### performed_procedures Value:
      property(get_performed_procedures, lambda x: x)

  ### current_encounter Value:
      property(_get_current_encounter, _set_current_encounter)

  ### active_encounter Value:
      property(_get_current_encounter, _set_current_encounter)

  ### earliest_care_date Value:
      property(get_earliest_care_date, lambda x: x)