def run(conn=None):

	# CD/DVD sleeve
	gmPG2.file2bytea (
		query = u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea,
				external_version = '21.0'
			WHERE
				name_long = 'CD/DVD sleeve [K.Hilbert]'""",
		filename = os.path.join('..', 'sql', 'v20-v21', 'data', 'v21-CD_DVD-sleeve.tex'),
		conn = conn
	)

	# Begleitbrief
	gmPG2.file2bytea (
		query = u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea,
				external_version = '21.8'
			WHERE
				name_long = 'Begleitbrief ohne medizinische Daten [K.Hilbert]'""",
		filename = os.path.join('..', 'sql', 'v20-v21', 'data', 'v21-Begleitbrief.tex'),
		conn = conn
	)

	# AMTS Medikationsplan v2.3, nicht konform
	gmPG2.file2bytea (
		query = u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea
			WHERE
				name_long = 'Medikationsplan 2.3 (AMTS, Deutschland)'""",
		filename = os.path.join('..', 'sql', 'v20-v21', 'data', 'v21-Medikationsplan_AMTS-2.3.tex'),
		conn = conn
	)

	# AMTS Medikationsplan v2.3, nicht konform
	gmPG2.file2bytea (
		query = u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea
			WHERE
				name_long = 'Medikationsplan AMTS (~2.3, NICHT konform, Deutschland)'""",
		filename = os.path.join('..', 'sql', 'v20-v21', 'data', 'v21-Medikationsplan_AMTS-2.3-nicht_konform.tex'),
		conn = conn
	)

	# AMTS Medikationsplan v2.3, nicht konform, blanko
	gmPG2.file2bytea (
		query = u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea
			WHERE
				name_long = 'Medikationsplan AMTS (blanko, ~2.3, NICHT konform, Deutschland)'""",
		filename = os.path.join('..', 'sql', 'v20-v21', 'data', 'v21-Medikationsplan_AMTS-2.3-nicht_konform-blanko.tex'),
		conn = conn
	)

	return True
Example #2
0
def run(conn=None):

	gmPG2.file2bytea (
		query = u"""
update ref.paperwork_templates
set
	data = %(data)s::bytea,
	external_version = 'v21.0'
where
	name_long = '1 test type plot script (GNUmed default)'
""",
		filename = os.path.join('..', 'sql', 'v20-v21', 'data', 'v21-gm2gpl-plot_one_test.gpl'),
		conn = conn
	)

	gmPG2.file2bytea (
		query = u"""
update ref.paperwork_templates
set
	data = %(data)s::bytea,
	external_version = 'v21.0'
where
	name_long = '2 test types plot script (GNUmed default)'
""",
		filename = os.path.join('..', 'sql', 'v20-v21', 'data', 'v21-gm2gpl-plot_two_tests.gpl'),
		conn = conn
	)

	return True
Example #3
0
def run(conn=None):

    # medication list
    gmPG2.file2bytea(query=u"""
update ref.paperwork_templates
set data = %(data)s::bytea
where name_long = 'Current medication list (GNUmed default)'
""",
                     filename=os.path.join(
                         '..', 'sql', 'v11-v12', 'data',
                         'GNUmed-default_medication_list_template.tex'),
                     conn=conn)

    # referral letter
    gmPG2.file2bytea(query=u"""
update ref.paperwork_templates
set data = %(data)s::bytea
where name_long = 'Referral letter (GNUmed default) [Dr.Rogerio Luz]'
""",
                     filename=os.path.join(
                         '..', 'sql', 'v11-v12', 'data',
                         'GNUmed-default_referral_letter_template.tex'),
                     conn=conn)

    return True
Example #4
0
def run(conn=None):

    # medication list
    gmPG2.file2bytea(
        query=u"""
update ref.paperwork_templates
set
	data = %(data)s::bytea,
	external_version = 'v16.0'
where
	name_long = 'Current medication list (GNUmed default)'
""",
        filename=os.path.join("..", "sql", "v15-v16", "data", "v16-GNUmed-default_medication_list_template.tex"),
        conn=conn,
    )

    # Formularkopf
    gmPG2.file2bytea(
        query=u"""
update ref.paperwork_templates
set
	data = %(data)s::bytea,
	external_version = 'v16.0'
where
	name_long = 'Formularkopf (GNUmed-Vorgabe)'
""",
        filename=os.path.join("..", "sql", "v15-v16", "data", "v16-GNUmed-default_GKV_Formularkopf_template.tex"),
        conn=conn,
    )

    return True
def run(conn=None):

	# medication list
	gmPG2.file2bytea (
		query = u"""
update ref.paperwork_templates
set
	data = %(data)s::bytea,
	external_version = 'v16.0'
where
	name_long = 'Current medication list (GNUmed default)'
""",
		filename = os.path.join('..', 'sql', 'v15-v16', 'data', 'v16-GNUmed-default_medication_list_template.tex'),
		conn = conn
	)


	# Formularkopf
	gmPG2.file2bytea (
		query = u"""
update ref.paperwork_templates
set
	data = %(data)s::bytea,
	external_version = 'v16.0'
where
	name_long = 'Formularkopf (GNUmed-Vorgabe)'
""",
		filename = os.path.join('..', 'sql', 'v15-v16', 'data', 'v16-GNUmed-default_GKV_Formularkopf_template.tex'),
		conn = conn
	)


	return True
def run(conn=None):

    for filename in template_files:

        args = {}
        args['sname'] = os.path.splitext(filename)[0].replace('-',
                                                              ', ').replace(
                                                                  '_', ', ')
        args['lname'] = u'%s (GNUmed Default)' % args['sname']
        args['ttype'] = template_type
        args['fname'] = filename

        queries = []

        # delete this template
        cmd = u"""delete from ref.paperwork_templates where name_long = %(lname)s"""
        queries.append({'cmd': cmd, 'args': args})

        # and (re-)import it
        # - template
        cmd = u"""
			INSERT INTO ref.paperwork_templates (
				fk_template_type,
				instance_type,
				name_short,
				name_long,
				external_version,
				filename,
				engine,
				data
			) VALUES (
				(SELECT pk FROM ref.form_types WHERE name = %(ttype)s),
				%(sname)s,
				%(sname)s,
				%(lname)s,
				'16.0'::TEXT,
				%(fname)s,
				'I'::TEXT,
				'image data missing'::BYTEA
			)"""
        queries.append({'cmd': cmd, 'args': args})

        gmPG2.run_rw_queries(link_obj=conn, queries=queries, end_tx=False)

        # - data
        cmd = u"""
			UPDATE ref.paperwork_templates
			SET data = %(data)s::BYTEA
			WHERE name_long = %(lname)s"""
        gmPG2.file2bytea(query=cmd,
                         filename=os.path.join('..', 'sql', 'v15-v16', 'data',
                                               filename),
                         conn=conn,
                         args=args)

    conn.commit()

    return True
def run(conn=None):

	for filename in template_files:

		args = {}
		args['sname'] = os.path.splitext(filename)[0].replace('-', ', ').replace('_', ', ')
		args['lname'] = u'%s (GNUmed Default)' % args['sname']
		args['ttype'] = template_type
		args['fname'] = filename

		queries = []

		# delete this template
		cmd = u"""delete from ref.paperwork_templates where name_long = %(lname)s"""
		queries.append({'cmd': cmd, 'args': args})

		# and (re-)import it
		# - template
		cmd = u"""
			INSERT INTO ref.paperwork_templates (
				fk_template_type,
				instance_type,
				name_short,
				name_long,
				external_version,
				filename,
				engine,
				data
			) VALUES (
				(SELECT pk FROM ref.form_types WHERE name = %(ttype)s),
				%(sname)s,
				%(sname)s,
				%(lname)s,
				'16.0'::TEXT,
				%(fname)s,
				'I'::TEXT,
				'image data missing'::BYTEA
			)"""
		queries.append({'cmd': cmd, 'args': args})

		gmPG2.run_rw_queries(link_obj = conn, queries = queries, end_tx = False)

		# - data
		cmd = u"""
			UPDATE ref.paperwork_templates
			SET data = %(data)s::BYTEA
			WHERE name_long = %(lname)s"""
		gmPG2.file2bytea (
			query = cmd,
			filename = os.path.join('..', 'sql', 'v15-v16', 'data', filename),
			conn = conn,
			args = args
		)

	conn.commit()

	return True
Example #8
0
def run(conn=None):
	gmPG2.file2bytea (
		query = u"""
update ref.paperwork_templates
set data = %(data)s::bytea
where name_long = 'Therapiebericht Physiotherapie (GNUmed-Standard)'
""",
		filename = os.path.join('..', 'sql', 'v6-v7', 'data', 'GNUmed-PT-Therapiebericht-Rezeptrueckseite.ott'),
		conn = conn
	)
Example #9
0
	def update_image_from_file(self, filename=None):
		# sanity check
		if not (os.access(filename, os.R_OK) and os.path.isfile(filename)):
			_log.error('[%s] is not a readable file' % filename)
			return False

		gmPG2.file2bytea (
			query = "UPDATE ref.tag_image SET image = %(data)s::bytea WHERE pk = %(pk)s",
			filename = filename,
			args = {'pk': self.pk_obj}
		)

		# must update XMIN now ...
		self.refetch_payload()
		return True
Example #10
0
File: gmHL7.py Project: sk/gnumed
	def update_data_from_file(self, fname=None):
		# sanity check
		if not (os.access(fname, os.R_OK) and os.path.isfile(fname)):
			_log.error('[%s] is not a readable file' % fname)
			return False

		gmPG2.file2bytea (
			query = u"UPDATE clin.incoming_data_unmatched SET data = %(data)s::bytea WHERE pk = %(pk)s",
			filename = fname,
			args = {'pk': self.pk_obj}
		)

		# must update XMIN now ...
		self.refetch_payload()
		return True
Example #11
0
    def update_image_from_file(self, filename=None):
        # sanity check
        if not (os.access(filename, os.R_OK) and os.path.isfile(filename)):
            _log.error('[%s] is not a readable file' % filename)
            return False

        gmPG2.file2bytea(
            query=
            "UPDATE ref.tag_image SET image = %(data)s::bytea WHERE pk = %(pk)s",
            filename=filename,
            args={'pk': self.pk_obj})

        # must update XMIN now ...
        self.refetch_payload()
        return True
Example #12
0
def run(conn=None):

    # update
    gmPG2.file2bytea(query=u"""
			UPDATE ref.paperwork_templates
			SET
				data = %(data)s::bytea,
				external_version = 'v23.0'
			WHERE
				name_long = 'lab results plot: many test types (GNUmed default)'
			""",
                     filename=os.path.join('..', 'sql', 'v22-v23', 'data',
                                           'v23-gm2gpl-plot_many_tests.gpl'),
                     conn=conn)

    return True
Example #13
0
def run(conn=None):

	#------------------------------------
	# recalls
	gmPG2.file2bytea (
		query = u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea,
				external_version = '22.17'
			WHERE
				name_long = 'Upcoming Recalls (GNUmed default)'""",
		filename = os.path.join('..', 'sql', 'v21-v22', 'data', 'v22-GNUmed-default_recalls_template.tex'),
		conn = conn
	)
	#------------------------------------
	return True
Example #14
0
    def update_data_from_file(self, fname=None):
        # sanity check
        if not (os.access(fname, os.R_OK) and os.path.isfile(fname)):
            _log.error('[%s] is not a readable file' % fname)
            return False

        _log.debug('updating [pk=%s] from [%s]', self.pk_obj, fname)
        gmPG2.file2bytea(
            query=
            u"UPDATE clin.incoming_data_unmatched SET data = %(data)s::bytea WHERE pk = %(pk)s",
            filename=fname,
            args={'pk': self.pk_obj})

        # must update XMIN now ...
        self.refetch_payload()
        return True
Example #15
0
def run(conn=None):
	gmPG2.file2bytea (
		query = u"""
update ref.paperwork_templates
set data = %(data)s::bytea
where name_long = 'Therapiebericht Physiotherapie (GNUmed-Standard)'
""",
		filename = os.path.join('..', 'sql', 'v6-v7', 'data', 'GNUmed-PT-Therapiebericht-Rezeptrueckseite.ott'),
		conn = conn
	)

#==============================================================
# $Log: import-form-templates.py,v $
# Revision 1.1  2007-09-18 22:48:14  ncq
# - added
#
#
Example #16
0
def run(conn=None):

	#------------------------------------
	# Begleitbrief
	gmPG2.file2bytea (
		query = u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea,
				external_version = '22.6'
			WHERE
				name_long = 'Begleitbrief ohne medizinische Daten [K.Hilbert]'""",
		filename = os.path.join('..', 'sql', 'v21-v22', 'data', 'v22-Begleitbrief.tex'),
		conn = conn
	)

	# vaccination history
	gmPG2.file2bytea (
		query = u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea,
				external_version = '22.4'
			where
				name_long = 'Vaccination history (GNUmed default)'""",
		filename = os.path.join('..', 'sql', 'v21-v22', 'data', 'v22-GNUmed-default_vaccination_history_template.tex'),
		conn = conn
	)

	# most recent vaccinations record
	gmPG2.file2bytea (
		query = u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea,
				external_version = '22.4'
			WHERE
				name_long = 'Most recent vaccinations (GNUmed default)'
			""",
		filename = os.path.join('..', 'sql', 'v21-v22', 'data', 'v22-GNUmed-default_latest_vaccinations_record_template.tex'),
		conn = conn
	)

	# medication list
	gmPG2.file2bytea (
		query = u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea,
				external_version = '22.4'
			WHERE
				name_long = 'Current medication list (GNUmed default)'
			""",
		filename = os.path.join('..', 'sql', 'v21-v22', 'data', 'v22-GNUmed-default_medication_list_template.tex'),
		conn = conn
	)
	#------------------------------------
	return True
Example #17
0
	def update_data_from_file(self, filename=None):
		if not (os.access(filename, os.R_OK) and os.path.isfile(filename)):
			_log.error('[%s] is not a readable file' % filename)
			return False

		gmPG2.file2bytea (
			query = u"UPDATE ref.keyword_expansion SET binary_data = %(data)s::bytea, textual_data = NULL WHERE pk = %(pk)s",
			filename = filename,
			args = {'pk': self.pk_obj}
		)

		# must update XMIN now ...
		self.refetch_payload()

		global __textual_expansion_keywords
		__textual_expansion_keywords = None
		global __keyword_expansions
		__keyword_expansions = None

		return True
def run(conn=None):

	# Begleitbrief
	gmPG2.file2bytea (
		query = u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea,
				external_version = '22.0'
			WHERE
				name_long = 'Begleitbrief ohne medizinische Daten [K.Hilbert]'""",
		filename = os.path.join('..', 'sql', 'v21-v22', 'data', 'v22-Begleitbrief.tex'),
		conn = conn
	)

	# German current meds list
	gmPG2.file2bytea (
		query = u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea,
				external_version = '22.0'
			WHERE
				name_long = 'Liste aktueller Medikamente (GNUmed)'""",
		filename = os.path.join('..', 'sql', 'v21-v22', 'data', 'v22-aktuelle-Medikationsliste.tex'),
		conn = conn
	)

	return True

#---------------------------

	# AMTS Medikationsplan
	gmPG2.file2bytea (
		query = u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea
			WHERE
				name_long = 'Medikationsplan (Deutschland, AMTS)'""",
		filename = os.path.join('..', 'sql', 'v21-v22', 'data', 'v22-Medikationsplan_AMTS-2.0.tex'),
		conn = conn
	)

	# AMTS Medikationsplan (nicht konform)
	gmPG2.file2bytea (
		query = u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea
			WHERE
				name_long = 'Medikationsplan (Deutschland, NICHT konform zu AMTS)'""",
		filename = os.path.join('..', 'sql', 'v21-v22', 'data', 'v22-Medikationsplan_AMTS-2.0-nicht_konform.tex'),
		conn = conn
	)
Example #19
0
def run(conn=None):

    gmPG2.file2bytea(query=u"""
update ref.paperwork_templates
set data = %(data)s::bytea
where name_long = '1 test type plot script (GNUmed default)'
""",
                     filename=os.path.join('..', 'sql', 'v13-v14', 'data',
                                           'gm2gpl-plot_1_test.scr'),
                     conn=conn)

    gmPG2.file2bytea(query=u"""
update ref.paperwork_templates
set data = %(data)s::bytea
where name_long = '2 test types plot script (GNUmed default)'
""",
                     filename=os.path.join('..', 'sql', 'v13-v14', 'data',
                                           'gm2gpl-plot_2_tests.scr'),
                     conn=conn)

    return True
Example #20
0
def run(conn=None):

	gmPG2.file2bytea (
		query = u"""
update ref.paperwork_templates
set data = %(data)s::bytea
where name_long = '1 test type plot script (GNUmed default)'
""",
		filename = os.path.join('..', 'sql', 'v13-v14', 'data', 'gm2gpl-plot_1_test.scr'),
		conn = conn
	)

	gmPG2.file2bytea (
		query = u"""
update ref.paperwork_templates
set data = %(data)s::bytea
where name_long = '2 test types plot script (GNUmed default)'
""",
		filename = os.path.join('..', 'sql', 'v13-v14', 'data', 'gm2gpl-plot_2_tests.scr'),
		conn = conn
	)

	return True
Example #21
0
def run(conn=None):

	# medication list
	gmPG2.file2bytea (
		query = u"""
update ref.paperwork_templates
set data = %(data)s::bytea
where name_long = 'Current medication list (GNUmed default)'
""",
		filename = os.path.join('..', 'sql', 'v11-v12', 'data', 'GNUmed-default_medication_list_template.tex'),
		conn = conn
	)

	# referral letter
	gmPG2.file2bytea (
		query = u"""
update ref.paperwork_templates
set data = %(data)s::bytea
where name_long = 'Referral letter (GNUmed default) [Dr.Rogerio Luz]'
""",
		filename = os.path.join('..', 'sql', 'v11-v12', 'data', 'GNUmed-default_referral_letter_template.tex'),
		conn = conn
	)

	return True

#==============================================================
# $Log: import-form-templates.py,v $
# Revision 1.2  2010-01-21 08:49:31  ncq
# - import referral letter template, too
#
# Revision 1.1  2009/12/22 12:01:08  ncq
# - import meds list template
#
#
#
Example #22
0
	def update_data_from_file(self, fname=None, link_obj=None):
		# sanity check
		if not (os.access(fname, os.R_OK) and os.path.isfile(fname)):
			_log.error('[%s] is not a readable file' % fname)
			return False

		cmd = "UPDATE blobs.doc_obj SET data = %(data)s::BYTEA WHERE pk = %(pk)s RETURNING md5(data) AS md5"
		args = {'pk': self.pk_obj}
		md5 = gmTools.file2md5(filename = fname, return_hex = True)
		if not gmPG2.file2bytea(conn = link_obj, query = cmd, filename = fname, args = args, file_md5 = md5):
			return False

		# must update XMIN now ...
		self.refetch_payload(link_obj = link_obj)
		return True
Example #23
0
	def update_data_from_file(self, fname=None, link_obj=None):
		# sanity check
		if not (os.access(fname, os.R_OK) and os.path.isfile(fname)):
			_log.error('[%s] is not a readable file' % fname)
			return False

		if not gmPG2.file2bytea (
			conn = link_obj,
			query = "UPDATE blobs.doc_obj SET data = %(data)s::bytea WHERE pk = %(pk)s RETURNING md5(data) AS md5",
			filename = fname,
			args = {'pk': self.pk_obj},
			file_md5 = gmTools.file2md5(filename = fname, return_hex = True)
		):
			return False

		# must update XMIN now ...
		self.refetch_payload(link_obj = link_obj)
		return True
Example #24
0
    def update_data_from_file(self, filename=None):
        # sanity check
        if not (os.access(filename, os.R_OK) and os.path.isfile(filename)):
            _log.error('[%s] is not a readable file' % filename)
            return False

        cmd = u"""
			UPDATE clin.export_item SET
				data = %(data)s::bytea,
				fk_doc_obj = NULL,
				filename = gm.nullify_empty_string(%(fname)s)
			WHERE pk = %(pk)s"""
        args = {'pk': self.pk_obj, 'fname': filename}
        if not gmPG2.file2bytea(query=cmd, filename=filename, args=args):
            return False

        # must update XMIN now ...
        self.refetch_payload()
        return True
Example #25
0
	def update_data_from_file(self, filename=None):
		# sanity check
		if not (os.access(filename, os.R_OK) and os.path.isfile(filename)):
			_log.error('[%s] is not a readable file' % filename)
			return False

		cmd = u"""
			UPDATE clin.export_item SET
				data = %(data)s::bytea,
				fk_doc_obj = NULL,
				filename = gm.nullify_empty_string(%(fname)s)
			WHERE pk = %(pk)s"""
		args = {'pk': self.pk_obj, 'fname': filename}
		if not gmPG2.file2bytea(query = cmd, filename = filename, args = args):
			return False

		# must update XMIN now ...
		self.refetch_payload()
		return True
Example #26
0
def run(conn=None):

	# invalid GKV-Rezept
	gmPG2.file2bytea (
		query = u"""
			update ref.paperwork_templates set
				data = %(data)s::bytea,
				external_version = '19.0'
			where
				name_long = 'ungültiges GKV-Rezept (GNUmed-Vorgabe)'""",
		filename = os.path.join('..', 'sql', 'v18-v19', 'data', 'v19-GNUmed-INVALID_default_GKV_Rezept_template.tex'),
		conn = conn
	)

	# Grünes Rezept
	gmPG2.file2bytea (
		query = u"""
			update ref.paperwork_templates set
				data = %(data)s::bytea,
				external_version = '19.0'
			where
				name_long = 'Grünes Rezept (DE, GNUmed-Vorgabe)'""",
		filename = os.path.join('..', 'sql', 'v18-v19', 'data', 'v19-GNUmed-Gruenes_Rezept_template.tex'),
		conn = conn
	)

	# medication list
	gmPG2.file2bytea (
		query = u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea,
				external_version = '19.0'
			WHERE
				name_long = 'Current medication list (GNUmed default)'
			""",
		filename = os.path.join('..', 'sql', 'v18-v19', 'data', 'v19-GNUmed-default_medication_list_template.tex'),
		conn = conn
	)

	return True
Example #27
0
def run(conn=None):

    # invalid GKV-Rezept
    gmPG2.file2bytea(query=u"""
			update ref.paperwork_templates set
				data = %(data)s::bytea,
				external_version = '19.0'
			where
				name_long = 'ungültiges GKV-Rezept (GNUmed-Vorgabe)'""",
                     filename=os.path.join(
                         '..', 'sql', 'v18-v19', 'data',
                         'v19-GNUmed-INVALID_default_GKV_Rezept_template.tex'),
                     conn=conn)

    # Grünes Rezept
    gmPG2.file2bytea(query=u"""
			update ref.paperwork_templates set
				data = %(data)s::bytea,
				external_version = '19.0'
			where
				name_long = 'Grünes Rezept (DE, GNUmed-Vorgabe)'""",
                     filename=os.path.join(
                         '..', 'sql', 'v18-v19', 'data',
                         'v19-GNUmed-Gruenes_Rezept_template.tex'),
                     conn=conn)

    # medication list
    gmPG2.file2bytea(query=u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea,
				external_version = '19.0'
			WHERE
				name_long = 'Current medication list (GNUmed default)'
			""",
                     filename=os.path.join(
                         '..', 'sql', 'v18-v19', 'data',
                         'v19-GNUmed-default_medication_list_template.tex'),
                     conn=conn)

    return True
Example #28
0
def run(conn=None):

	# medication list
	gmPG2.file2bytea (
		query = u"""
update ref.paperwork_templates
set data = %(data)s::bytea
where name_long = 'Current medication list (GNUmed default)'
""",
		filename = os.path.join('..', 'sql', 'v13-v14', 'data', 'GNUmed-default_medication_list_template.tex'),
		conn = conn
	)

	# referral letter
	gmPG2.file2bytea (
		query = u"""
update ref.paperwork_templates
set data = %(data)s::bytea
where name_long = 'Referral letter (GNUmed default) [Dr.Rogerio Luz]'
""",
		filename = os.path.join('..', 'sql', 'v13-v14', 'data', 'GNUmed-default_referral_letter_template.tex'),
		conn = conn
	)

	# most recent vaccinations record
	gmPG2.file2bytea (
		query = u"""
update ref.paperwork_templates
set data = %(data)s::bytea
where name_long = 'Most recent vaccinations (GNUmed default)'
""",
		filename = os.path.join('..', 'sql', 'v13-v14', 'data', 'GNUmed-default_latest_vaccinations_record_template.tex'),
		conn = conn
	)

	return True
Example #29
0
def run(conn=None):

	# AMTS Medikationsplan
	gmPG2.file2bytea (
		query = u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea
			WHERE
				name_long = 'Medikationsplan (Deutschland, AMTS)'""",
		filename = os.path.join('..', 'sql', 'v20-v21', 'data', 'v21-Medikationsplan_AMTS-2.0.tex'),
		conn = conn
	)

	# AMTS Medikationsplan (nicht konform)
	gmPG2.file2bytea (
		query = u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea
			WHERE
				name_long = 'Medikationsplan (Deutschland, NICHT konform zu AMTS)'""",
		filename = os.path.join('..', 'sql', 'v20-v21', 'data', 'v21-Medikationsplan_AMTS-2.0-nicht_konform.tex'),
		conn = conn
	)

	# German current meds list
	gmPG2.file2bytea (
		query = u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea
			WHERE
				name_long = 'Liste aktueller Medikamente (GNUmed)'""",
		filename = os.path.join('..', 'sql', 'v20-v21', 'data', 'v21-aktuelle-Medikationsliste.tex'),
		conn = conn
	)

	return True
Example #30
0
def run(conn=None):

    gmPG2.file2bytea(query=u"""
UPDATE ref.tag_image
SET image = %(data)s::bytea
WHERE description = 'Occupation: astronaut'
""",
                     filename=os.path.join(
                         '..', 'sql', 'v14-v15', 'data',
                         'johnny_automatic_astronaut_s_helmet.png'),
                     conn=conn)

    gmPG2.file2bytea(query=u"""
UPDATE ref.tag_image
SET image = %(data)s::bytea
WHERE description = 'smokes'
""",
                     filename=os.path.join('..', 'sql', 'v14-v15', 'data',
                                           'Anonymous_aiga_smoking.png'),
                     conn=conn)

    gmPG2.file2bytea(query=u"""
UPDATE ref.tag_image
SET image = %(data)s::bytea
WHERE description = 'often late'
""",
                     filename=os.path.join('..', 'sql', 'v14-v15', 'data',
                                           'CoD_fsfe_Pocket_watch_icon.png'),
                     conn=conn)

    gmPG2.file2bytea(query=u"""
UPDATE ref.tag_image
SET image = %(data)s::bytea
WHERE description = 'Extra care !'
""",
                     filename=os.path.join(
                         '..', 'sql', 'v14-v15', 'data',
                         'eastshores_Warning_Notification.png'),
                     conn=conn)

    gmPG2.file2bytea(query=u"""
UPDATE ref.tag_image
SET image = %(data)s::bytea
WHERE description = 'mobility impairment'
""",
                     filename=os.path.join(
                         '..', 'sql', 'v14-v15', 'data',
                         'schoolfreeware_WheelChair_Sign.png'),
                     conn=conn)

    gmPG2.file2bytea(query=u"""
UPDATE ref.tag_image
SET image = %(data)s::bytea
WHERE description = 'minor depression'
""",
                     filename=os.path.join('..', 'sql', 'v14-v15', 'data',
                                           'weather-few-clouds.png'),
                     conn=conn)

    gmPG2.file2bytea(query=u"""
UPDATE ref.tag_image
SET image = %(data)s::bytea
WHERE description = 'major depression'
""",
                     filename=os.path.join('..', 'sql', 'v14-v15', 'data',
                                           'weather-showers-scattered.png'),
                     conn=conn)

    gmPG2.file2bytea(query=u"""
UPDATE ref.tag_image
SET image = %(data)s::bytea
WHERE description = 'choleric'
""",
                     filename=os.path.join('..', 'sql', 'v14-v15', 'data',
                                           'weather-storm.png'),
                     conn=conn)

    return True
Example #31
0
def run(conn=None):

	# medication list
	gmPG2.file2bytea (
		query = u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea,
				external_version = '17.0'
			WHERE
				name_long = 'Current medication list (GNUmed default)'
			""",
		filename = os.path.join('..', 'sql', 'v16-v17', 'data', 'v17-GNUmed-default_medication_list_template.tex'),
		conn = conn
	)

	# most recent vaccinations record
	gmPG2.file2bytea (
		query = u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea,
				external_version = '17.0'
			WHERE
				name_long = 'Most recent vaccinations (GNUmed default)'
			""",
		filename = os.path.join('..', 'sql', 'v16-v17', 'data', 'v17-GNUmed-default_latest_vaccinations_record_template.tex'),
		conn = conn
	)

	# vaccination history
	gmPG2.file2bytea (
		query = u"""
			update ref.paperwork_templates set
				data = %(data)s::bytea,
				external_version = '17.0'
			where
				name_long = 'Vaccination history (GNUmed default)'""",
		filename = os.path.join('..', 'sql', 'v16-v17', 'data', 'v17-GNUmed-default_vaccination_history_template.tex'),
		conn = conn
	)

	# Vorsorgevollmacht
	gmPG2.file2bytea (
		query = u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea
			WHERE
				name_long = 'Vorsorgevollmacht (Bundesministerium für Justiz, Deutschland)'""",
		filename = os.path.join('..', 'sql', 'v16-v17', 'data', 'DE_BMJ-Vorsorgevollmacht_Vorlage-11_2009.pdf'),
		conn = conn
	)

	# PKV-Rechnung mit USt.
	gmPG2.file2bytea (
		query = u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea
			WHERE
				name_long = 'Privatrechnung mit USt. (GNUmed-Vorgabe Deutschland)'""",
		filename = os.path.join('..', 'sql', 'v16-v17', 'data', 'v17-GNUmed-default_invoice_template-de.tex'),
		conn = conn
	)

	# PKV-Rechnung ohne USt.
	gmPG2.file2bytea (
		query = u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea
			WHERE
				name_long = 'Privatrechnung ohne USt. (GNUmed-Vorgabe Deutschland)'""",
		filename = os.path.join('..', 'sql', 'v16-v17', 'data', 'v17-GNUmed-default_invoice_template-de_no_vat.tex'),
		conn = conn
	)

	return True
def run(conn=None):

    # emr journal
    gmPG2.file2bytea(query=u"""
update ref.paperwork_templates
set data = %(data)s::bytea
where name_long = 'EMR Journal (GNUmed default)'
""",
                     filename=os.path.join(
                         '..', 'sql', 'v14-v15', 'data',
                         'GNUmed-default_emr_journal_template.tex'),
                     conn=conn)

    # medical statement (certificate)
    gmPG2.file2bytea(query=u"""
update ref.paperwork_templates
set data = %(data)s::bytea
where name_long = 'Medical statement (GNUmed default)'
""",
                     filename=os.path.join(
                         '..', 'sql', 'v14-v15', 'data',
                         'GNUmed-default_medical_statement_template.tex'),
                     conn=conn)

    # Bescheinigung
    gmPG2.file2bytea(query=u"""
update ref.paperwork_templates
set data = %(data)s::bytea
where name_long = 'Bescheinigung (GNUmed-Vorgabe)'
""",
                     filename=os.path.join(
                         '..', 'sql', 'v14-v15', 'data',
                         'GNUmed-default_bescheinigung_template.tex'),
                     conn=conn)

    # referral letter
    gmPG2.file2bytea(query=u"""
update ref.paperwork_templates
set
	data = %(data)s::bytea,
	external_version = 'v15'
where name_long = 'Referral letter (GNUmed default) [Dr.Rogerio Luz]'
""",
                     filename=os.path.join(
                         '..', 'sql', 'v14-v15', 'data',
                         'GNUmed-default_referral_letter_template.tex'),
                     conn=conn)

    # consultation report
    gmPG2.file2bytea(query=u"""
update ref.paperwork_templates
set
	data = %(data)s::bytea,
	external_version = 'v15'
where name_long = 'Consultation report (GNUmed default)'
""",
                     filename=os.path.join(
                         '..', 'sql', 'v14-v15', 'data',
                         'GNUmed-default_consultation_report_template.tex'),
                     conn=conn)

    return True
Example #33
0
def run(conn=None):

	# vaccination history
	gmPG2.file2bytea (
		query = u"""
			update ref.paperwork_templates set
				data = %(data)s::bytea,
				external_version = '18.4'
			where
				name_long = 'Vaccination history (GNUmed default)'""",
		filename = os.path.join('..', 'sql', 'v17-v18', 'data', 'v18-GNUmed-default_vaccination_history_template.tex'),
		conn = conn
	)

	# invalid GKV-Rezept
	gmPG2.file2bytea (
		query = u"""
			update ref.paperwork_templates set
				data = %(data)s::bytea,
				external_version = '18.4'
			where
				name_long = 'ungültiges GKV-Rezept (GNUmed-Vorgabe)'""",
		filename = os.path.join('..', 'sql', 'v17-v18', 'data', 'v18-GNUmed-INVALID_default_GKV_Rezept_template.tex'),
		conn = conn
	)

	# LMcC autograph
	gmPG2.file2bytea (
		query = u"""
			update ref.keyword_expansion set
				textual_data = NULL,
				binary_data = %(data)s::bytea
			where
				keyword = 'autograph-LMcC'""",
		filename = os.path.join('..', 'sql', 'v17-v18', 'data', 'v18-LMcC_autograph.png'),
		conn = conn
	)

	# 1x1 pixels transparent PNG for use in overpic LaTeX environments
	gmPG2.file2bytea (
		query = u"""
			update ref.keyword_expansion set
				textual_data = NULL,
				binary_data = %(data)s::bytea
			where
				keyword = '1x1-transparent-PNG'""",
		filename = os.path.join('..', 'sql', 'v17-v18', 'data', 'v18-1x1-transparent.png'),
		conn = conn
	)

	# recalls
	gmPG2.file2bytea (
		query = u"""
			update ref.paperwork_templates set
				data = %(data)s::bytea,
				external_version = '18.0'
			where
				name_long = 'Upcoming Recalls (GNUmed default)'""",
		filename = os.path.join('..', 'sql', 'v17-v18', 'data', 'v18-GNUmed-default_recalls_template.tex'),
		conn = conn
	)

	# referral letter
	gmPG2.file2bytea (
		query = u"""
update ref.paperwork_templates
set
	data = %(data)s::bytea,
	external_version = '18.4'
where name_long = 'Referral letter (GNUmed default) [Dr.Rogerio Luz]'
""",
		filename = os.path.join('..', 'sql', 'v17-v18', 'data', 'v18-GNUmed-default_referral_letter_template.tex'),
		conn = conn
	)

	# most recent vaccinations record
	gmPG2.file2bytea (
		query = u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea,
				external_version = '18.4'
			WHERE
				name_long = 'Most recent vaccinations (GNUmed default)'
			""",
		filename = os.path.join('..', 'sql', 'v17-v18', 'data', 'v18-GNUmed-default_latest_vaccinations_record_template.tex'),
		conn = conn
	)

	# consultation report
	gmPG2.file2bytea (
		query = u"""
update ref.paperwork_templates
set
	data = %(data)s::bytea,
	external_version = '18.4'
where name_long = 'Consultation report (GNUmed default)'
""",
		filename = os.path.join('..', 'sql', 'v17-v18', 'data', 'v18-GNUmed-default_consultation_report_template.tex'),
		conn = conn
	)

	# emr journal
	gmPG2.file2bytea (
		query = u"""
update ref.paperwork_templates
set
	data = %(data)s::bytea,
	external_version = '18.4'
where name_long = 'EMR Journal (GNUmed default)'
""",
		filename = os.path.join('..', 'sql', 'v17-v18', 'data', 'v18-GNUmed-default_emr_journal_template.tex'),
		conn = conn
	)

	return True
Example #34
0
def run(conn=None):

    # medication list
    gmPG2.file2bytea(query=u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea,
				external_version = '17.0'
			WHERE
				name_long = 'Current medication list (GNUmed default)'
			""",
                     filename=os.path.join(
                         '..', 'sql', 'v16-v17', 'data',
                         'v17-GNUmed-default_medication_list_template.tex'),
                     conn=conn)

    # most recent vaccinations record
    gmPG2.file2bytea(
        query=u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea,
				external_version = '17.0'
			WHERE
				name_long = 'Most recent vaccinations (GNUmed default)'
			""",
        filename=os.path.join(
            '..', 'sql', 'v16-v17', 'data',
            'v17-GNUmed-default_latest_vaccinations_record_template.tex'),
        conn=conn)

    # vaccination history
    gmPG2.file2bytea(
        query=u"""
			update ref.paperwork_templates set
				data = %(data)s::bytea,
				external_version = '17.0'
			where
				name_long = 'Vaccination history (GNUmed default)'""",
        filename=os.path.join(
            '..', 'sql', 'v16-v17', 'data',
            'v17-GNUmed-default_vaccination_history_template.tex'),
        conn=conn)

    # Vorsorgevollmacht
    gmPG2.file2bytea(query=u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea
			WHERE
				name_long = 'Vorsorgevollmacht (Bundesministerium für Justiz, Deutschland)'""",
                     filename=os.path.join(
                         '..', 'sql', 'v16-v17', 'data',
                         'DE_BMJ-Vorsorgevollmacht_Vorlage-11_2009.pdf'),
                     conn=conn)

    # PKV-Rechnung mit USt.
    gmPG2.file2bytea(query=u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea
			WHERE
				name_long = 'Privatrechnung mit USt. (GNUmed-Vorgabe Deutschland)'""",
                     filename=os.path.join(
                         '..', 'sql', 'v16-v17', 'data',
                         'v17-GNUmed-default_invoice_template-de.tex'),
                     conn=conn)

    # PKV-Rechnung ohne USt.
    gmPG2.file2bytea(query=u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea
			WHERE
				name_long = 'Privatrechnung ohne USt. (GNUmed-Vorgabe Deutschland)'""",
                     filename=os.path.join(
                         '..', 'sql', 'v16-v17', 'data',
                         'v17-GNUmed-default_invoice_template-de_no_vat.tex'),
                     conn=conn)

    return True
Example #35
0
def run(conn=None):

	gmPG2.file2bytea (
		query = u"""
UPDATE ref.tag_image
SET image = %(data)s::bytea
WHERE description = 'Occupation: astronaut'
""",
		filename = os.path.join('..', 'sql', 'v14-v15', 'data', 'johnny_automatic_astronaut_s_helmet.png'),
		conn = conn
	)

	gmPG2.file2bytea (
		query = u"""
UPDATE ref.tag_image
SET image = %(data)s::bytea
WHERE description = 'smokes'
""",
		filename = os.path.join('..', 'sql', 'v14-v15', 'data', 'Anonymous_aiga_smoking.png'),
		conn = conn
	)

	gmPG2.file2bytea (
		query = u"""
UPDATE ref.tag_image
SET image = %(data)s::bytea
WHERE description = 'often late'
""",
		filename = os.path.join('..', 'sql', 'v14-v15', 'data', 'CoD_fsfe_Pocket_watch_icon.png'),
		conn = conn
	)

	gmPG2.file2bytea (
		query = u"""
UPDATE ref.tag_image
SET image = %(data)s::bytea
WHERE description = 'Extra care !'
""",
		filename = os.path.join('..', 'sql', 'v14-v15', 'data', 'eastshores_Warning_Notification.png'),
		conn = conn
	)

	gmPG2.file2bytea (
		query = u"""
UPDATE ref.tag_image
SET image = %(data)s::bytea
WHERE description = 'mobility impairment'
""",
		filename = os.path.join('..', 'sql', 'v14-v15', 'data', 'schoolfreeware_WheelChair_Sign.png'),
		conn = conn
	)

	gmPG2.file2bytea (
		query = u"""
UPDATE ref.tag_image
SET image = %(data)s::bytea
WHERE description = 'minor depression'
""",
		filename = os.path.join('..', 'sql', 'v14-v15', 'data', 'weather-few-clouds.png'),
		conn = conn
	)

	gmPG2.file2bytea (
		query = u"""
UPDATE ref.tag_image
SET image = %(data)s::bytea
WHERE description = 'major depression'
""",
		filename = os.path.join('..', 'sql', 'v14-v15', 'data', 'weather-showers-scattered.png'),
		conn = conn
	)

	gmPG2.file2bytea (
		query = u"""
UPDATE ref.tag_image
SET image = %(data)s::bytea
WHERE description = 'choleric'
""",
		filename = os.path.join('..', 'sql', 'v14-v15', 'data', 'weather-storm.png'),
		conn = conn
	)

	return True
Example #36
0
def run(conn=None):

	# PKV-Rechnung mit USt.
	gmPG2.file2bytea (
		query = u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea,
				external_version = '20.0'
			WHERE
				name_long = 'Privatrechnung mit USt. (GNUmed-Vorgabe Deutschland)'""",
		filename = os.path.join('..', 'sql', 'v19-v20', 'data', 'v20-GNUmed-default_invoice_template-de.tex'),
		conn = conn
	)

	# PKV-Rechnung ohne USt.
	gmPG2.file2bytea (
		query = u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea,
				external_version = '20.0'
			WHERE
				name_long = 'Privatrechnung ohne USt. (GNUmed-Vorgabe Deutschland)'""",
		filename = os.path.join('..', 'sql', 'v19-v20', 'data', 'v20-GNUmed-default_invoice_template-de_no_vat.tex'),
		conn = conn
	)

	# referral letter
	gmPG2.file2bytea (
		query = u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea,
				external_version = '20.0'
			WHERE
				name_long = 'Referral letter (GNUmed default) [Dr.Rogerio Luz]'""",
		filename = os.path.join('..', 'sql', 'v19-v20', 'data', 'v20-GNUmed-default_referral_letter_template.tex'),
		conn = conn
	)

	# Begleitbrief
	gmPG2.file2bytea (
		query = u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea,
				external_version = '20.0'
			WHERE
				name_long = 'Begleitbrief ohne medizinische Daten [K.Hilbert]'""",
		filename = os.path.join('..', 'sql', 'v19-v20', 'data', 'v20-Begleitbrief.tex'),
		conn = conn
	)

	# consultation report
	gmPG2.file2bytea (
		query = u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea,
				external_version = '20.4'
			WHERE
				name_long = 'Consultation report (GNUmed default)'""",
		filename = os.path.join('..', 'sql', 'v19-v20', 'data', 'v20-GNUmed-default_consultation_report_template.tex'),
		conn = conn
	)

	return True
def run(conn=None):

    # PKV-Rechnung mit USt.
    gmPG2.file2bytea(query=u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea,
				external_version = '20.0'
			WHERE
				name_long = 'Privatrechnung mit USt. (GNUmed-Vorgabe Deutschland)'""",
                     filename=os.path.join(
                         '..', 'sql', 'v19-v20', 'data',
                         'v20-GNUmed-default_invoice_template-de.tex'),
                     conn=conn)

    # PKV-Rechnung ohne USt.
    gmPG2.file2bytea(query=u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea,
				external_version = '20.0'
			WHERE
				name_long = 'Privatrechnung ohne USt. (GNUmed-Vorgabe Deutschland)'""",
                     filename=os.path.join(
                         '..', 'sql', 'v19-v20', 'data',
                         'v20-GNUmed-default_invoice_template-de_no_vat.tex'),
                     conn=conn)

    # referral letter
    gmPG2.file2bytea(query=u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea,
				external_version = '20.0'
			WHERE
				name_long = 'Referral letter (GNUmed default) [Dr.Rogerio Luz]'""",
                     filename=os.path.join(
                         '..', 'sql', 'v19-v20', 'data',
                         'v20-GNUmed-default_referral_letter_template.tex'),
                     conn=conn)

    # Begleitbrief
    gmPG2.file2bytea(query=u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea,
				external_version = '20.0'
			WHERE
				name_long = 'Begleitbrief ohne medizinische Daten [K.Hilbert]'""",
                     filename=os.path.join('..', 'sql', 'v19-v20', 'data',
                                           'v20-Begleitbrief.tex'),
                     conn=conn)

    # consultation report
    gmPG2.file2bytea(
        query=u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea,
				external_version = '20.4'
			WHERE
				name_long = 'Consultation report (GNUmed default)'""",
        filename=os.path.join(
            '..', 'sql', 'v19-v20', 'data',
            'v20-GNUmed-default_consultation_report_template.tex'),
        conn=conn)

    return True
Example #38
0
def run(conn=None):

	# emr journal
	gmPG2.file2bytea (
		query = u"""
update ref.paperwork_templates
set data = %(data)s::bytea
where name_long = 'EMR Journal (GNUmed default)'
""",
		filename = os.path.join('..', 'sql', 'v14-v15', 'data', 'GNUmed-default_emr_journal_template.tex'),
		conn = conn
	)

	# medical statement (certificate)
	gmPG2.file2bytea (
		query = u"""
update ref.paperwork_templates
set data = %(data)s::bytea
where name_long = 'Medical statement (GNUmed default)'
""",
		filename = os.path.join('..', 'sql', 'v14-v15', 'data', 'GNUmed-default_medical_statement_template.tex'),
		conn = conn
	)

	# Bescheinigung
	gmPG2.file2bytea (
		query = u"""
update ref.paperwork_templates
set data = %(data)s::bytea
where name_long = 'Bescheinigung (GNUmed-Vorgabe)'
""",
		filename = os.path.join('..', 'sql', 'v14-v15', 'data', 'GNUmed-default_bescheinigung_template.tex'),
		conn = conn
	)

	# referral letter
	gmPG2.file2bytea (
		query = u"""
update ref.paperwork_templates
set
	data = %(data)s::bytea,
	external_version = 'v15'
where name_long = 'Referral letter (GNUmed default) [Dr.Rogerio Luz]'
""",
		filename = os.path.join('..', 'sql', 'v14-v15', 'data', 'GNUmed-default_referral_letter_template.tex'),
		conn = conn
	)

	# consultation report
	gmPG2.file2bytea (
		query = u"""
update ref.paperwork_templates
set
	data = %(data)s::bytea,
	external_version = 'v15'
where name_long = 'Consultation report (GNUmed default)'
""",
		filename = os.path.join('..', 'sql', 'v14-v15', 'data', 'GNUmed-default_consultation_report_template.tex'),
		conn = conn
	)

	return True
Example #39
0
def run(conn=None):

	# Begleitbrief
	gmPG2.file2bytea (
		query = u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea,
				external_version = '22.9'
			WHERE
				name_long = 'Begleitbrief ohne medizinische Daten [K.Hilbert]'""",
		filename = os.path.join('..', 'sql', 'v21-v22', 'data', 'v22-Begleitbrief.tex'),
		conn = conn
	)

	# German current meds list
	gmPG2.file2bytea (
		query = u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea,
				external_version = '22.4'
			WHERE
				name_long = 'Liste aktueller Medikamente (GNUmed)'""",
		filename = os.path.join('..', 'sql', 'v21-v22', 'data', 'v22-aktuelle-Medikationsliste.tex'),
		conn = conn
	)

	# GNUmed icons
	gmPG2.file2bytea (
		query = u"""
			update ref.keyword_expansion set
				textual_data = NULL,
				binary_data = %(data)s::bytea
			where
				keyword = '$$gnumed_patient_media_export_icon'""",
		filename = os.path.join('..', 'sql', 'v21-v22', 'data', 'GNUmed_Data_2.ico'),
		conn = conn
	)

	gmPG2.file2bytea (
		query = u"""
			update ref.keyword_expansion set
				textual_data = NULL,
				binary_data = %(data)s::bytea
			where
				keyword = '$$gnumed_patient_media_export_icon_2'""",
		filename = os.path.join('..', 'sql', 'v21-v22', 'data', 'GNUmed_Data.ico'),
		conn = conn
	)

	# Begleitbrief mit Diagnosen
	gmPG2.file2bytea (
		query = u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea,
				external_version = '22.9'
			WHERE
				name_long = 'Begleitbrief mit Diagnosen [K.Hilbert]'""",
		filename = os.path.join('..', 'sql', 'v21-v22', 'data', 'v22-Begleitbrief_mit_Diagnosen.tex'),
		conn = conn
	)

	return True

#---------------------------

	# AMTS Medikationsplan
	gmPG2.file2bytea (
		query = u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea
			WHERE
				name_long = 'Medikationsplan (Deutschland, AMTS)'""",
		filename = os.path.join('..', 'sql', 'v21-v22', 'data', 'v22-Medikationsplan_AMTS-2.0.tex'),
		conn = conn
	)

	# AMTS Medikationsplan (nicht konform)
	gmPG2.file2bytea (
		query = u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea
			WHERE
				name_long = 'Medikationsplan (Deutschland, NICHT konform zu AMTS)'""",
		filename = os.path.join('..', 'sql', 'v21-v22', 'data', 'v22-Medikationsplan_AMTS-2.0-nicht_konform.tex'),
		conn = conn
	)
Example #40
0
def run(conn=None):

	# Begleitbrief
	gmPG2.file2bytea (
		query = u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea,
				external_version = '22.6'
			WHERE
				name_long = 'Begleitbrief ohne medizinische Daten [K.Hilbert]'""",
		filename = os.path.join('..', 'sql', 'v21-v22', 'data', 'v22-Begleitbrief.tex'),
		conn = conn
	)

	# German current meds list
	gmPG2.file2bytea (
		query = u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea,
				external_version = '22.4'
			WHERE
				name_long = 'Liste aktueller Medikamente (GNUmed)'""",
		filename = os.path.join('..', 'sql', 'v21-v22', 'data', 'v22-aktuelle-Medikationsliste.tex'),
		conn = conn
	)

	# GNUmed icons
	gmPG2.file2bytea (
		query = u"""
			update ref.keyword_expansion set
				textual_data = NULL,
				binary_data = %(data)s::bytea
			where
				keyword = '$$gnumed_patient_media_export_icon'""",
		filename = os.path.join('..', 'sql', 'v21-v22', 'data', 'GNUmed_Data_2.ico'),
		conn = conn
	)

	gmPG2.file2bytea (
		query = u"""
			update ref.keyword_expansion set
				textual_data = NULL,
				binary_data = %(data)s::bytea
			where
				keyword = '$$gnumed_patient_media_export_icon_2'""",
		filename = os.path.join('..', 'sql', 'v21-v22', 'data', 'GNUmed_Data.ico'),
		conn = conn
	)

	# Begleitbrief mit Diagnosen
	gmPG2.file2bytea (
		query = u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea,
				external_version = '22.6'
			WHERE
				name_long = 'Begleitbrief mit Diagnosen [K.Hilbert]'""",
		filename = os.path.join('..', 'sql', 'v21-v22', 'data', 'v22-Begleitbrief_mit_Diagnosen.tex'),
		conn = conn
	)

	return True

#---------------------------

	# AMTS Medikationsplan
	gmPG2.file2bytea (
		query = u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea
			WHERE
				name_long = 'Medikationsplan (Deutschland, AMTS)'""",
		filename = os.path.join('..', 'sql', 'v21-v22', 'data', 'v22-Medikationsplan_AMTS-2.0.tex'),
		conn = conn
	)

	# AMTS Medikationsplan (nicht konform)
	gmPG2.file2bytea (
		query = u"""
			UPDATE ref.paperwork_templates SET
				data = %(data)s::bytea
			WHERE
				name_long = 'Medikationsplan (Deutschland, NICHT konform zu AMTS)'""",
		filename = os.path.join('..', 'sql', 'v21-v22', 'data', 'v22-Medikationsplan_AMTS-2.0-nicht_konform.tex'),
		conn = conn
	)