Example #1
0
 def test_generate_invoice_id():
     from Gnumed.pycommon import gmI18N
     gmI18N.activate_locale()
     gmI18N.install_domain()
     import gmPerson
     for idx in range(1, 15):
         print('')
         print('classic:', generate_invoice_id(pk_patient=idx))
         pat = gmPerson.cPerson(idx)
         template = u'%(firstname).4s%(lastname).4s%(date)s'
         print('new: template = "%s" => %s' %
               (template,
                generate_invoice_id(template=template,
                                    pk_patient=None,
                                    person=pat,
                                    date_format='%d%m%Y',
                                    time_format='%H%M%S')))
         template = u'%(firstname).4s%(lastname).4s%(date)s-#counter#'
         new_id = generate_invoice_id(template=template,
                                      pk_patient=None,
                                      person=pat,
                                      date_format='%d%m%Y',
                                      time_format='%H%M%S')
         print('locked: %s' % lock_invoice_id(new_id))
         print('new: template = "%s" => %s' % (template, new_id))
         print('unlocked: %s' % unlock_invoice_id(new_id))
Example #2
0
import logging
import os.path
import time


import wx


if __name__ == '__main__':
	sys.path.insert(0, '../../')

from Gnumed.pycommon import gmI18N

if __name__ == '__main__':
	gmI18N.activate_locale()
	gmI18N.install_domain()

from Gnumed.pycommon import gmDispatcher
from Gnumed.pycommon import gmTools
from Gnumed.pycommon import gmDateTime
from Gnumed.pycommon import gmCfg

from Gnumed.business import gmPerson
from Gnumed.business import gmStaff
from Gnumed.business import gmEMRStructItems
from Gnumed.business import gmSoapDefs
from Gnumed.business import gmPraxis
from Gnumed.business import gmPersonSearch

from Gnumed.wxpython import gmListWidgets
from Gnumed.wxpython import gmEMRStructWidgets
Example #3
0
			include_without_provider = include_without_provider
		)

#============================================================
if __name__ == '__main__':

	if len(sys.argv) < 2:
		sys.exit()

	if sys.argv[1] != 'test':
		sys.exit()

	from Gnumed.pycommon import gmI18N

	gmI18N.activate_locale()
	gmI18N.install_domain()

	#---------------------------------------
	def test_inbox():
		gmStaff.gmCurrentProvider(provider = gmStaff.cStaff())
		inbox = cProviderInbox()
		for msg in inbox.messages:
			print(msg)
	#---------------------------------------
	def test_msg():
		msg = cInboxMessage(aPK_obj = 1)
		print(msg)
	#---------------------------------------
	def test_create_type():
		print(create_inbox_item_type(message_type = 'test'))
	#---------------------------------------
Example #4
0
__license__ = "GPL"

import sys
import logging
import io

if __name__ == '__main__':
    sys.path.insert(0, '../../')
from Gnumed.pycommon import gmBusinessDBObject
from Gnumed.pycommon import gmPG2
from Gnumed.pycommon import gmI18N
from Gnumed.pycommon import gmTools
from Gnumed.pycommon import gmDateTime
if __name__ == '__main__':
    gmI18N.activate_locale()
    gmI18N.install_domain()
from Gnumed.business import gmMedication

_log = logging.getLogger('gm.vacc')

#============================================================
URL_vaccination_plan = u'http://www.rki.de/DE/Content/Infekt/EpidBull/Archiv/2017/Ausgaben/34_17.pdf?__blob=publicationFile'

#============================================================
_SQL_create_substance4vaccine = u"""-- in case <%(substance_tag)s> already exists: add ATC
UPDATE ref.substance SET atc = '%(atc)s' WHERE lower(description) = lower('%(desc)s') AND atc IS NULL;

INSERT INTO ref.substance (description, atc)
	SELECT
		'%(desc)s',
		'%(atc)s'
Example #5
0
        return _('unmapped entry type from table [%s]') % table


#============================================================
# main - unit testing
#------------------------------------------------------------
if __name__ == '__main__':

    if len(sys.argv) < 2:
        sys.exit()

    if sys.argv[1] != 'test':
        sys.exit()

    gmI18N.activate_locale()
    gmI18N.install_domain('gnumed')

    gmPG2.request_login_params(setup_pool=True)

    #--------------------------------------------------------
    def test_gen_item():
        for item in get_generic_emr_items(order_by=None,
                                          patient=12,
                                          return_pks=False):
            print('------------------------------')
            print(item.format(eol='\n'))
            print(item.staff_id)
            input('<next>')
            #print(item.specialized_item)
            #input('<next>')
Example #6
0
#================================================================
__author__ = "Karsten Hilbert <*****@*****.**>"
__license__ = "GPL v2 or later"

import logging
import sys
import os.path


import wx

if __name__ == '__main__':
	sys.path.insert(0, '../../')
	from Gnumed.pycommon import gmI18N
	gmI18N.activate_locale()
	gmI18N.install_domain(domain = 'gnumed')
from Gnumed.pycommon import gmTools
from Gnumed.pycommon import gmMatchProvider

from Gnumed.business import gmATC

from Gnumed.wxpython import gmAuthWidgets
from Gnumed.wxpython import gmListWidgets
from Gnumed.wxpython import gmPhraseWheel


_log = logging.getLogger('gm.ui.atc')

#============================================================
def browse_atc_reference_deprecated(parent=None):
Example #7
0
    def cleanup(self):
        # cleanup
        self.__gm_server.unlock_patient(self.__conn_auth, self.__unlock_auth)
        self.__gm_server.detach(self.__conn_auth)


#==================================================================
if __name__ == '__main__':

    _cfg = gmCfg2.gmCfgData()

    _cfg.add_cli(long_options=['text-domain=', 'lang-gettext=', 'conf-file='])
    td = _cfg.get(option='--text-domain', source_order=[('cli', 'return')])
    l = _cfg.get(option='--lang-gettext', source_order=[('cli', 'return')])
    gmI18N.activate_locale()
    gmI18N.install_domain(domain=td, language=l)

    _cfg.add_file_source(source='explicit',
                         file=_cfg.get(option='--conf-file',
                                       source=[('cli', 'return')]),
                         encoding=gmI18N.get_encoding())

    connector = cBaseConnector()
    if not connector.connect():
        sys.exit('connect() error')
    if not connector.setup():
        connector.cleanup()
        sys.exit('setup() error')
    if not connector.run_script():
        connector.cleanup()
        sys.exit('run_script() error')
Example #8
0
    if len(sys.argv) < 2:
        sys.exit()

    if sys.argv[1] != "test":
        sys.exit()

        # we don't have tests yet
    sys.exit()

    from Gnumed.pycommon import gmI18N

    logging.basicConfig(level=logging.DEBUG)

    gmI18N.activate_locale()
    gmI18N.install_domain(domain="gnumed")
    # -----------------------------------------------
    # -----------------------------------------------
    def test():
        app = wx.PyWidgetTester(size=(300, 400))
        # show the login panel in a main window
        # 		app.SetWidget(cLoginPanel, -1)
        # and pop the login dialog up modally
        dlg = cLoginDialog(None, -1)  # , png_bitmap = 'bitmaps/gnumedlogo.png')
        dlg.ShowModal()
        # demonstration how to access the login dialog values
        lp = dlg.panel.GetLoginInfo()
        if lp is None:
            wx.MessageBox(_("Dialog was cancelled by user"))
        else:
            wx.MessageBox(
Example #9
0
	#--------------------------------------------------------------
	def cleanup(self):
		# cleanup
		self.__gm_server.unlock_patient(self.__conn_auth, self.__unlock_auth)
		self.__gm_server.detach(self.__conn_auth)

#==================================================================
if __name__ == '__main__':

	_cfg = gmCfg2.gmCfgData()

	_cfg.add_cli(long_options = ['text-domain=', 'lang-gettext=', 'conf-file='])
	td = _cfg.get(option = '--text-domain', source_order = [('cli', 'return')])
	l = _cfg.get(option = '--lang-gettext', source_order = [('cli', 'return')])
	gmI18N.activate_locale()
	gmI18N.install_domain(domain = td, language = l)

	_cfg.add_file_source (
		source = 'explicit',
		file = _cfg.get(option = '--conf-file', source = [('cli', 'return')]),
		encoding = gmI18N.get_encoding()
	)

	connector = cBaseConnector()
	if not connector.connect():
		sys.exit('connect() error')
	if not connector.setup():
		connector.cleanup()
		sys.exit('setup() error')
	if not connector.run_script():
		connector.cleanup()