Gnumed.business.gmPathLab

Package Gnumed :: Package business :: Module gmPathLab |
[frames] | no frames]

# Module gmPathLab

source code

GNUmed measurements related business objects.

Author: K.Hilbert <Karsten.Hilbert@gmx.net>

License: GPL

Classes
| cTestOrg Represents one test org/lab.
| cTestPanel Represents a grouping/listing of tests into a panel.
| cMetaTestType Represents one meta test type under which actual test types can be aggregated.
| cMeasurementType Represents one test result type.
| cTestResult Represents one test result.
| cLabResult Represents one lab result.
| cLabRequest Represents one lab request.

Functions
create_test_org(name=None, comment=None, pk_org_unit=None, link_obj=None) | source code
delete_test_org(test_org=None) | source code
get_test_orgs(order_by='unit') | source code
get_test_panels(order_by=None, loincs=None) | source code
create_test_panel(description=None) | source code
delete_test_panel(pk=None) | source code
create_meta_type(name=None, abbreviation=None, return_existing=False) | source code
delete_meta_type(meta_type=None) | source code
get_meta_test_types() | source code
get_measurement_types(order_by=None, loincs=None) | source code
find_measurement_type(lab=None, abbrev=None, name=None, link_obj=None) | source code
delete_measurement_type(measurement_type=None) | source code
create_measurement_type(lab=None, abbrev=None, unit=None, name=None, link_obj=None) Create or get test type. | source code
get_test_results(pk_patient=None, encounters=None, episodes=None, order_by=None) | source code
get_most_recent_results_for_panel(pk_patient=None, pk_panel=None, order_by=None, group_by_meta_type=False) | source code
get_result_at_timestamp(timestamp=None, test_type=None, loinc=None, tolerance_interval=None, patient=None) | source code
get_results_for_day(timestamp=None, patient=None, order_by=None) | source code
get_results_for_issue(pk_health_issue=None, order_by=None) | source code
get_results_for_episode(pk_episode=None) | source code
get_most_recent_results_in_loinc_group(loincs=None, no_of_results=1, patient=None, consider_meta_type=False, max_age=None) Get N most recent results *among* a list of tests selected by LOINC. | source code
get_most_recent_results_for_test_type(test_type=None, no_of_results=1, patient=None) Get N most recent results for *a* (one) given test type. | source code
get_most_recent_result_for_test_types(pk_test_types=None, pk_patient=None) Return the one most recent result for *each* of a list of test types. | source code
get_most_recent_results_for_patient(no_of_results=1, patient=None) Get N most recent results for a given patient. | source code
get_oldest_result(test_type=None, loinc=None, patient=None) | source code
delete_test_result(result=None) | source code
create_test_result(encounter=None, episode=None, type=None, intended_reviewer=None, val_num=None, val_alpha=None, unit=None, link_obj=None) | source code
format_test_results(results=None, output_format='latex') | source code
export_results_for_gnuplot(results=None, filename=None, show_year=True) | source code
create_lab_request(lab=None, req_id=None, pat_id=None, encounter_id=None, episode_id=None) Create or get lab request. | source code
create_lab_result(patient_id=None, when_field=None, when=None, test_type=None, val_num=None, val_alpha=None, unit=None, encounter_id=None, request=None) | source code
get_unreviewed_results(limit=50) | source code
get_pending_requests(limit=250) | source code
get_next_request_ID(lab=None, incrementor_func=None) Get logically next request ID for given lab. | source code
calculate_bmi(mass=None, height=None, age=None) Calculate BMI. | source code

Variables
| HL7_RESULT_STATI = `{None: _('unknown'), '': _('empty status'),`...``
| URL_test_result_information = `'http://www.laborlexikon.de'`
| URL_test_result_information_search = `"http://www.google.de/sea`...``

Imports: sys, logging, io, decimal, regex, gmDateTime, gmExceptions, gmBusinessDBObject, gmPG2, gmTools, gmDispatcher, gmHooks, gmOrganization, gmCoding

Function Details

### create_lab_request(lab=None, req_id=None, pat_id=None, encounter_id=None, episode_id=None) | source code
    Create or get lab request.

    returns tuple (status, value):
            (True, lab request instance)
            (False, error message)
            (None, housekeeping_todo primary key)

### get_next_request_ID(lab=None, incrementor_func=None) | source code
    Get logically next request ID for given lab.

    - incrementor_func:
      - if not supplied the next ID is guessed
      - if supplied it is applied to the most recently used ID

### calculate_bmi(mass=None, height=None, age=None) | source code
    Calculate BMI.

    mass: kg
    height: cm
    age: not yet used

    returns:
            (True/False, data)
            True: data = (bmi, lower_normal, upper_normal)
            False: data = error message

Variables Details

  ### HL7_RESULT_STATI Value:
      {None: _('unknown'), '': _('empty status'), 'C': _('C (HL7: Correction
      , replaces previous final)'), 'D': _('D (HL7: Deletion)'), 'F': _('F (
      HL7: Final)'), 'I': _('I (HL7: pending, specimen In lab)'), 'P': _('P
      (HL7: Preliminary)'), 'R': _('R (HL7: result entered, not yet verified
      )'), 'S': _('S (HL7: partial)'), 'X': _('X (HL7: cannot obtain results
       for this observation)'), 'U': _('U (HL7: mark as final (I/P/R/S -> F,
       value Unchanged)'), 'W': _('W (HL7: original Wrong (say, wrong patien
      t))')}

  ### URL_test_result_information_search Value:
      "http://www.google.de/search?as_oq=%(search_term)s&num=10&as_sitesearc
      h=laborlexikon.de"