Gnumed.business.gmClinicalRecord.cClinicalRecord

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

# Class cClinicalRecord

source code

    object --+
             |
            cClinicalRecord

Instance Methods
__init__(self, aPKey=None) Fails if | source code
cleanup(self) | source code
log_access(self, action=None) | source code
db_modification_callback(self, **kwds) | source code
db_callback_encounter_mod_db(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
format_harmful_substance_use(self, include_tobacco=True, include_alcohol=True, include_drugs=True, include_nonuse=True, include_unknown=True) | 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_procedure_locations_as_org_units(self) | 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, fk_org_unit=None) | source code
get_hospital_stay_stats_by_hospital(self, cover_period=None) | source code
get_attended_hospitals_as_org_units(self) | source code
add_notes(self, notes=None, episode=None, encounter=None) | source code
add_clin_narrative(self, note='', soap_cat='s', episode=None, link_obj=None) | source code
get_clin_narrative(self, encounters=None, episodes=None, issues=None, soap_cats=None, providers=None) Get SOAP notes pertinent to this encounter. | source code
search_narrative_simple(self, search_term='') | 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) | source code
format_as_journal(self, left_margin=0, patient=None) | 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
get_generic_emr_items(self, pk_encounters=None, pk_episodes=None, pk_health_issues=None, use_active_encounter=False, order_by=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, product_name=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_external_care_items(self, order_by=None, exclude_inactive=False) | 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, allow_dupes=False, link_obj=None) 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_candidate_diagnoses(self) | source code
candidate_diagnoses(self) | 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_medications(self, include_inactive=True, include_unapproved=False, order_by=None, episodes=None, issues=None) | source code
add_substance_intake(self, pk_component=None, pk_episode=None, pk_drug_product=None, pk_health_issue=None) | source code
substance_intake_exists(self, pk_component=None, pk_substance=None, pk_drug_product=None) | source code
add_vaccination(self, episode=None, vaccine=None, batch_no=None) | source code
get_latest_vaccinations(self, episodes=None, issues=None, atc_indications=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, order_by=None, max_encounters=None) 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_most_recent_care_date(self) | source code
most_recent_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_for_patient(self, no_of_results=1) | source code
get_most_recent_results_in_loinc_group(self, loincs=None, max_no_of_results=1, consider_indirect_matches=False) | source code
get_most_recent_results_for_test_type(self, test_type=None, max_no_of_results=1) | source code
get_most_recent_result_for_test_types(self, pk_test_types=None) | source code
get_result_at_timestamp(self, timestamp=None, test_type=None, loinc=None, tolerance_interval='12 hours') | source code
get_results_for_day(self, timestamp=None, order_by=None) | source code
get_results_for_issue(self, pk_health_issue=None, order_by=None) | source code
get_results_for_episode(self, pk_episode=None) | source code
get_unsigned_results(self, order_by=None) | source code
get_test_types_for_results(self, order_by=None, unique_meta_types=False) 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_issues_or_episodes_for_results(self, tests=None) Get the issues/episodes 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, link_obj=None) | source code
get_labs_as_org_units(self) | 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
| calculator = `property(_get_calculator, lambda x: x)`
| gender = `property(_get_gender, _set_gender)`
| dob = `property(_get_dob, _set_dob)`
| EDC = `property(_get_EDC, _set_EDC)`
| EDC_is_fishy = `property(_EDC_is_fishy, lambda x: x)`
| smoking_status = `property(_get_smoking_status, _set_smoking_st`...``
| alcohol_status = `property(_get_alcohol_status, _set_alcohol_st`...``
| drugs_status = `property(_get_drugs_status, _set_drugs_status)`
| harmful_substance_use = `property(_get_harmful_substance_use, l`...``
| currently_abuses_substances = `property(_get_currently_abuses_s`...``
| 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)`
| external_care_items = `property(get_external_care_items, lambda`...``
| 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)`
| abused_substances = `property(_get_abused_substances, 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`...``
| first_encounter = `property(get_first_encounter, lambda x: x)`
| earliest_care_date = `property(get_earliest_care_date, lambda x`...``
| last_encounter = `property(get_last_encounter, lambda x: x)`
| last_but_one_encounter = `property(get_last_but_one_encounter, `...``
| best_gfr_or_crea = `property(_get_best_gfr_or_crea, lambda x: x)`
| bmi = `property(_get_bmi, lambda x: x)`
| dynamic_hints = `property(_get_dynamic_hints, lambda x: x)`

Properties
Inherited from `object`: `__class__`

Method Details

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

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

### get_clin_narrative(self, encounters=None, episodes=None, issues=None, soap_cats=None, providers=None) | source code
Get SOAP notes pertinent to this encounter. encounters list of encounters the narrative of which are to be retrieved episodes list of episodes the narrative of which are to be retrieved issues list of health issues the narrative of which 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, allow_dupes=False, link_obj=None) | 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, atc_indications=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, order_by=None, max_encounters=None) | 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

  ### smoking_status Value:
      property(_get_smoking_status, _set_smoking_status)

  ### alcohol_status Value:
      property(_get_alcohol_status, _set_alcohol_status)

  ### harmful_substance_use Value:
      property(_get_harmful_substance_use, lambda x: x)

  ### currently_abuses_substances Value:
      property(_get_currently_abuses_substances, lambda x: x)

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

  ### external_care_items Value:
      property(get_external_care_items, 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)

  ### last_but_one_encounter Value:
      property(get_last_but_one_encounter, lambda x: x)