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

Module gmEMRStructItems

source code

GNUmed health related business object.

license: GPL v2 or later


Author: Carlos Moro <cfmoro1976@yahoo.es>, <karsten.hilbert@gmx.net>

Classes
  cHealthIssue
Represents one health issue.
  cEpisode
Represents one clinical episode.
  cEncounter
Represents one encounter.
  cProblem
Represents one problem.
  cHospitalStay
  cPerformedProcedure
Functions
 
diagnostic_certainty_classification2str(classification) source code
 
create_health_issue(description=None, encounter=None, patient=None)
Creates a new health issue for a given patient.
source code
 
delete_health_issue(health_issue=None) source code
 
get_dummy_health_issue() source code
 
health_issue2problem(health_issue=None, allow_irrelevant=False) source code
 
create_episode(pk_health_issue=None, episode_name=None, is_open=False, allow_dupes=False, encounter=None, link_obj=None)
Creates a new episode for a given patient's health issue.
source code
 
delete_episode(episode=None) source code
 
episode2problem(episode=None, allow_closed=False) source code
 
create_encounter(fk_patient=None, enc_type=None)
Creates a new encounter for a patient.
source code
 
lock_encounter(pk_encounter, exclusive=False, link_obj=None)
Used to protect against deletion of active encounter from another client.
source code
 
unlock_encounter(pk_encounter, exclusive=False, link_obj=None) source code
 
delete_encounter(pk_encounter)
Deletes an encounter by PK.
source code
 
update_encounter_type(description=None, l10n_description=None) source code
 
create_encounter_type(description=None, l10n_description=None)
This will attempt to create a NEW encounter type.
source code
 
get_most_commonly_used_encounter_type() source code
 
get_encounter_types() source code
 
get_encounter_type(description=None) source code
 
delete_encounter_type(description=None) source code
 
problem2episode(problem=None)
Retrieve the cEpisode instance equivalent to the given problem.
source code
 
problem2issue(problem=None)
Retrieve the cIssue instance equivalent to the given problem.
source code
 
reclass_problem(self, problem=None)
Transform given problem into either episode or health issue instance.
source code
 
get_latest_patient_hospital_stay(patient=None) source code
 
get_patient_hospital_stays(patient=None, ongoing_only=False) source code
 
create_hospital_stay(encounter=None, episode=None, fk_org_unit=None) source code
 
delete_hospital_stay(stay=None) source code
 
get_performed_procedures(patient=None) source code
 
get_procedures4document(pk_document=None) source code
 
get_latest_performed_procedure(patient=None) source code
 
create_performed_procedure(encounter=None, episode=None, location=None, hospital_stay=None, procedure=None) source code
 
delete_performed_procedure(procedure=None) source code
 
export_emr_structure(patient=None, filename=None) source code
 
check_fk_encounter_fk_episode_x_ref() source code
 
export_patient_emr_structure() source code
Variables
  laterality2str = {None: '?', 'na': '', 'sd': _('bilateral'), '...
  SQL_get_encounters = "SELECT * FROM clin.v_pat_encounters WHER...

Imports: sys, datetime, logging, io, os, gmPG2, gmI18N, gmTools, gmDateTime, gmBusinessDBObject, gmNull, gmExceptions, gmClinNarrative, gmSoapDefs, gmCoding, gmPraxis, gmOrganization, gmExternalCare, gmDocuments


Function Details

create_health_issue(description=None, encounter=None, patient=None)

source code 

Creates a new health issue for a given patient.

description - health issue name

create_episode(pk_health_issue=None, episode_name=None, is_open=False, allow_dupes=False, encounter=None, link_obj=None)

source code 

Creates a new episode for a given patient's health issue.

pk_health_issue - given health issue PK episode_name - name of episode

create_encounter(fk_patient=None, enc_type=None)

source code 

Creates a new encounter for a patient.

fk_patient - patient PK enc_type - type of encounter

delete_encounter(pk_encounter)

source code 
Deletes an encounter by PK.

- attempts to obtain an exclusive lock which should
  fail if the encounter is the active encounter in
  this or any other client
- catches DB exceptions which should mostly be related
  to clinical data already having been attached to
  the encounter thus making deletion fail

problem2episode(problem=None)

source code 

Retrieve the cEpisode instance equivalent to the given problem.

The problem's type attribute must be 'episode'

Parameters:
  • problem (A gmEMRStructItems.cProblem instance) - The problem to retrieve its related episode for

problem2issue(problem=None)

source code 

Retrieve the cIssue instance equivalent to the given problem.

The problem's type attribute must be 'issue'.

Parameters:
  • problem (A gmEMRStructItems.cProblem instance) - The problem to retrieve the corresponding issue for

Variables Details

laterality2str

Value:
{None: '?', 'na': '', 'sd': _('bilateral'), 'ds': _('bilateral'), 's':\
 _('left'), 'd': _('right')}

SQL_get_encounters

Value:
"SELECT * FROM clin.v_pat_encounters WHERE %s"