Package Gnumed :: Package wxpython :: Module gmGenericEMRItemWorkflows |
[frames] | no frames]

# Source Code for Module Gnumed.wxpython.gmGenericEMRItemWorkflows

     1  """GNUmed generic clinical item business object workflows."""
     2  #================================================================
     3  __author__ = "Karsten Hilbert <Karsten.Hilbert@gmx.net>"
     4  __license__ = "GPL v2 or later (details at http://www.gnu.org)"
     5
     6  import sys
     7  import logging
     8
     9
    10  import wx
    11
    12
    13  if __name__ == '__main__':
    14          sys.path.insert(0, '../../')
    15
    16  from Gnumed.pycommon import gmI18N
    17  from Gnumed.pycommon import gmDispatcher
    18
    19  from Gnumed.business.gmEMRStructItems import cHealthIssue
    20  from Gnumed.business.gmEMRStructItems import cEpisode
    21  from Gnumed.business.gmEMRStructItems import cEncounter
    22  from Gnumed.business.gmEMRStructItems import cHospitalStay
    23  from Gnumed.business.gmEMRStructItems import cPerformedProcedure
    24  from Gnumed.business.gmPathLab import cTestResult
    25  from Gnumed.business.gmMedication import cSubstanceIntakeEntry
    26  from Gnumed.business.gmFamilyHistory import cFamilyHistory
    27  from Gnumed.business.gmVaccination import cVaccination
    28  from Gnumed.business.gmExternalCare import cExternalCareItem
    29  from Gnumed.business.gmClinNarrative import cNarrative
    30  from Gnumed.business.gmAllergy import cAllergy
    31  from Gnumed.business.gmAllergy import cAllergyState
    32
    33  from Gnumed.wxpython.gmEMRStructWidgets import edit_health_issue
    34  from Gnumed.wxpython.gmEMRStructWidgets import edit_episode
    35  from Gnumed.wxpython.gmEncounterWidgets import edit_encounter
    36  from Gnumed.wxpython.gmHospitalStayWidgets import edit_hospital_stay
    37  from Gnumed.wxpython.gmMeasurementWidgets import edit_measurement
    38  from Gnumed.wxpython.gmMedicationWidgets import edit_intake_of_substance
    39  from Gnumed.wxpython.gmFamilyHistoryWidgets import edit_family_history
    40  from Gnumed.wxpython.gmVaccWidgets import edit_vaccination
    41  from Gnumed.wxpython.gmProcedureWidgets import edit_procedure
    42  from Gnumed.wxpython.gmExternalCareWidgets import edit_external_care_item
    43  from Gnumed.wxpython.gmNarrativeWorkflows import edit_narrative
    44  from Gnumed.wxpython.gmAllergyWidgets import edit_allergies
    45
    46
    47  _log = logging.getLogger('gm.ui')
    48
    49  #c: {'edit_in_dlg': edit_}
    50  __map_class2edit_call = {
    51          cEpisode: {'edit_in_dlg': edit_episode},
    52          cHealthIssue: {'edit_in_dlg': edit_health_issue},
    53          cHospitalStay: {'edit_in_dlg': edit_hospital_stay},
    54          cTestResult: {'edit_in_dlg': edit_measurement},
    55          cEncounter: {'edit_in_dlg': edit_encounter},
    56          cSubstanceIntakeEntry: {'edit_in_dlg': edit_intake_of_substance},
    57          cFamilyHistory: {'edit_in_dlg': edit_family_history},
    58          cVaccination: {'edit_in_dlg': edit_vaccination},
    59          cPerformedProcedure: {'edit_in_dlg': edit_procedure},
    60          cExternalCareItem: {'edit_in_dlg': edit_external_care_item},
    61          cNarrative: {'edit_in_dlg': edit_narrative},
    62          cAllergy: {'edit_in_dlg': edit_allergies},
    63          cAllergyState: {'edit_in_dlg': edit_allergies}
    64  }
    65  #'clin.suppressed_hint': gmAutoHints.cSuppressedHint,
    66  #'blobs.doc_med': cDocument,
    67  #'dem.message_inbox': cInboxMessage
    68
    69
    70  #================================================================
    71 -def edit_item_in_dlg(parent=None, item=None):
    72          try:
    73                  edit_func = __map_class2edit_call[type(item)]['edit_in_dlg']
    74          except KeyError:
    75                  gmDispatcher.send('statustext', msg = _('No editor for [%s]') % type(item))
    76                  return None
    77
    78          return edit_func(parent, item, single_entry = True)
    79
    80  #================================================================
    81  if __name__ == '__main__':
    82          gmI18N.activate_locale()
    83          gmI18N.install_domain()
    84