Commit 5e8b0111 authored by Andreas Tille's avatar Andreas Tille
Browse files

New upstream version 1.7.6+dfsg

parent 89909cca
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -6,6 +6,16 @@
# rel-1-7-patches
------------------------------------------------

	1.7.6

FIX: application metadata files
FIX: searching across all EMRs
FIX: constrain document PRW to current patient
FIX: lab/table: exception on double-clicking empty cell in row w/o meta test type
FIX: lab/result EA: failure to show test type on edit

NEW: stub out $praxis_scan2pay$

	1.7.5

FIX: exception on following vaccs reminder from provider inbox
@@ -1987,6 +1997,12 @@ FIX: missing cast to ::text in dem.date_trunc_utc() calls
# gnumed_v22
------------------------------------------------

	22.6

FIX: properly include fixups in v21-v22 upgrade

IMPROVED: database backup script

	22.4

FIX: LaTeX-Template for Begleitbrief
+9 −8
Original line number Diff line number Diff line
@@ -3,7 +3,8 @@
<!-- Thanks to Carsten Grohmann <mail@carstengrohmann.de> -->
<!-- Thanks to Richard Hughes (https://people.freedesktop.org/~hughsient/appdata/) -->
<component type="desktop">
 <id>gnumed_client.desktop</id>
 <id>de.gnumed.client</id>
 <launchable type="desktop-id">gnumed_client.desktop</launchable>
 <metadata_license>CC0-1.0</metadata_license>
 <project_license>GPL-2.0+ and GFDL-1.3</project_license>
 <name>GNUmed EMR</name>
@@ -28,14 +29,14 @@
	</p>
 </description>
 <screenshots>
	<screenshot type="default">
		<caption>http://wiki.gnumed.de</caption>
	</screenshot>
	<!--<screenshot type="default">
			<image>https://screenshots.debian.net/screenshots/000/002/117/large.png</image>
			<caption>The main window showing the application in action</caption>
		<caption>http://wiki.gnumed.de</caption>
	</screenshot>-->
	<screenshot type="default">
		<image>https://screenshots.debian.net/screenshots/000/002/117/large.png</image>
		<caption>The main window showing one of the ways to enter Progress Notes during a patient encounter</caption>
	</screenshot
 </screenshots>
 <url type="homepage">http://www.gnumed.de</url>
 <url type="homepage">https://www.gnumed.de</url>
 <update_contact>gnumed-devel_AT_gnu.org</update_contact>
</component>
+1 −0
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ AMTS_BMP_DOB_FORMAT_YEAR_ONLY = '%Y'
AMTS2GMD_GENDER_MAP = {
	'W': 'f',
	'M': 'm',
	'D': 'h',
	'X': None
}

+411 −3
Original line number Diff line number Diff line
@@ -498,6 +498,409 @@ def get_as_journal(since=None, until=None, encounters=None, episodes=None, issue
#============================================================
# convenience functions
#============================================================
__VIEW_DEF = """
create temporary view v_narrative4search as

select * from (

	-- clin.clin_root_items
	select
		vpi.pk_patient as pk_patient,
		vpi.soap_cat as soap_cat,
		vpi.narrative as narrative,
		vpi.pk_encounter as pk_encounter,
		vpi.pk_episode as pk_episode,
		vpi.pk_health_issue as pk_health_issue,
		vpi.pk_item as src_pk,
		vpi.src_table as src_table
	from
		clin.v_pat_items vpi
	where
		src_table not in (
			'clin.allergy',
			'clin.test_result',
			'clin.procedure',
			'clin.substance_intake',
			'clin.family_history'
		)


	union all

		select * from clin.v_subst_intake4narr_search
		where gm.is_null_or_blank_string(narrative) is FALSE


	union all
	select		-- clin.procedure
		(select fk_patient from clin.encounter where pk = cpr.fk_encounter)
			as pk_patient,
		cpr.soap_cat
			as soap_cat,
		cpr.narrative
			as narrative,
		cpr.fk_encounter
			as pk_encounter,
		cpr.fk_episode
			as pk_episode,
		(select fk_health_issue from clin.episode where pk = cpr.fk_episode)
			as pk_health_issue,
		cpr.pk
			as src_pk,
		'clin.procedure'
			as src_table
	from
		clin.procedure cpr
	where
		cpr.narrative is not NULL


	union all
	select		-- test results
		(select fk_patient from clin.encounter where pk = ctr.fk_encounter)
			as pk_patient,
		ctr.soap_cat
			as soap_cat,
		coalesce(ctr.narrative, '')
			|| coalesce(' ' || ctr.val_alpha, '')
			|| coalesce(' ' || ctr.val_unit, '')
			|| coalesce(' ' || ctr.val_normal_range, '')
			|| coalesce(' ' || ctr.val_target_range, '')
			|| coalesce(' ' || ctr.norm_ref_group, '')
			|| coalesce(' ' || ctr.note_test_org, '')
			|| coalesce(' ' || ctr.material, '')
			|| coalesce(' ' || ctr.material_detail, '')
			as narrative,
		ctr.fk_encounter
			as pk_encounter,
		ctr.fk_episode
			as pk_episode,
		(select fk_health_issue from clin.episode where pk = ctr.fk_episode)
			as pk_health_issue,
		ctr.pk
			as src_pk,
		'clin.test_result'
			as src_table
	from
		clin.test_result ctr


	union all	-- test result reviews
	select
		(select fk_patient from clin.encounter where pk =
			(select fk_encounter from clin.test_result where clin.test_result.pk = crtr.fk_reviewed_row)
		)
			as pk_patient,
		'o'::text
			as soap_cat,
		crtr.comment
			as narrative,
		(select fk_encounter from clin.test_result where clin.test_result.pk = crtr.fk_reviewed_row)
			as pk_encounter,
		(select fk_episode from clin.test_result where clin.test_result.pk = crtr.fk_reviewed_row)
			as pk_episode,
		(select fk_health_issue from clin.episode where pk =
			(select fk_episode from clin.test_result where clin.test_result.pk = crtr.fk_reviewed_row)
		)
			as pk_health_issue,
		crtr.pk
			as src_pk,
		'clin.reviewed_test_results'
			as src_table
	from
		clin.reviewed_test_results crtr


	union all
	select -- allergy state
		(select fk_patient from clin.encounter where pk = cas.fk_encounter)
			as pk_patient,
		'o'::text
			as soap_cat,
		cas.comment
			as narrative,
		cas.fk_encounter
			as pk_encounter,
		null
			as pk_episode,
		null
			as pk_health_issue,
		cas.pk
			as src_pk,
		'clin.allergy_state'
			as src_table
	from
		clin.allergy_state cas
	where
		cas.comment is not NULL


	union all
	select -- allergies
		(select fk_patient from clin.encounter where pk = ca.fk_encounter)
			as pk_patient,
		ca.soap_cat
			as soap_cat,
		coalesce(narrative, '')
			|| coalesce(' ' || substance, '')
			|| coalesce(' ' || substance_code, '')
			|| coalesce(' ' || generics, '')
			|| coalesce(' ' || allergene, '')
			|| coalesce(' ' || atc_code, '')
			as narrative,
		ca.fk_encounter
			as pk_encounter,
		ca.fk_episode
			as pk_episode,
		(select fk_health_issue from clin.episode where pk = ca.fk_episode)
			as pk_health_issue,
		ca.pk
			as src_pk,
		'clin.allergy'
			as src_table
	from
		clin.allergy ca


	union all	-- health issues
	select
		(select fk_patient from clin.encounter where pk = chi.fk_encounter)
			as pk_patient,
		'a' as soap_cat,
		chi.description
			|| coalesce(' ' || chi.summary, '')
			as narrative,
		chi.fk_encounter
			as pk_encounter,
		null
			as pk_episode,
		chi.pk
			as pk_health_issue,
		chi.pk
			as src_pk,
		'clin.health_issue'
			as src_table
	from
		clin.health_issue chi


	union all	-- encounters
	select
		cenc.fk_patient as pk_patient,
		's' as soap_cat,
		coalesce(cenc.reason_for_encounter, '')
			|| coalesce(' ' || cenc.assessment_of_encounter, '')
			as narrative,
		cenc.pk as pk_encounter,
		null as pk_episode,
		null as pk_health_issue,
		cenc.pk as src_pk,
		'clin.encounter' as src_table
	from
		clin.encounter cenc


	union all	-- episodes
	select
		(select fk_patient from clin.encounter where pk = cep.fk_encounter)
			as pk_patient,
		's' as soap_cat,
		cep.description
			|| coalesce(' ' || cep.summary, '')
			as narrative,
		cep.fk_encounter
			as pk_encounter,
		cep.pk
			as pk_episode,
		cep.fk_health_issue
			as pk_health_issue,
		cep.pk
			as src_pk,
		'clin.episode'
			as src_table
	from
		clin.episode cep


	union all	-- family history
	select
		c_vfhx.pk_patient,
		c_vfhx.soap_cat,
		(c_vfhx.relation || ' / ' || c_vfhx.l10n_relation || ' '
		 || c_vfhx.name_relative || ': '
		 || c_vfhx.condition
		) as narrative,
		c_vfhx.pk_encounter,
		c_vfhx.pk_episode,
		c_vfhx.pk_health_issue,
		c_vfhx.pk_family_history as src_pk,
		'clin.family_history' as src_table
	from
		clin.v_family_history c_vfhx


	union all	-- documents
	select
		vdm.pk_patient as pk_patient,
		'o' as soap_cat,
		(vdm.l10n_type || ' ' ||
		 coalesce(vdm.ext_ref, '') || ' ' ||
		 coalesce(vdm.comment, '')
		) as narrative,
		vdm.pk_encounter as pk_encounter,
		vdm.pk_episode as pk_episode,
		vdm.pk_health_issue as pk_health_issue,
		vdm.pk_doc as src_pk,
		'blobs.doc_med' as src_table
	from
		blobs.v_doc_med vdm


	union all	-- document objects
	select
		vo4d.pk_patient as pk_patient,
		'o' as soap_cat,
		vo4d.obj_comment as narrative,
		vo4d.pk_encounter as pk_encounter,
		vo4d.pk_episode as pk_episode,
		vo4d.pk_health_issue as pk_health_issue,
		vo4d.pk_obj as src_pk,
		'blobs.doc_obj' as src_table
	from
		blobs.v_obj4doc_no_data vo4d


	union all	-- document descriptions
	select
		vdd.pk_patient as pk_patient,
		'o' as soap_cat,
		vdd.description as narrative,
		vdd.pk_encounter as pk_encounter,
		vdd.pk_episode as pk_episode,
		vdd.pk_health_issue as pk_health_issue,
		vdd.pk_doc_desc as src_pk,
		'blobs.doc_desc' as src_table
	from
		blobs.v_doc_desc vdd


	union all	-- reviewed documents
	select
		vrdo.pk_patient as pk_patient,
		's' as soap_cat,
		vrdo.comment as narrative,
		null as pk_encounter,
		vrdo.pk_episode as pk_episode,
		vrdo.pk_health_issue as pk_health_issue,
		vrdo.pk_review_root as src_pk,
		'blobs.v_reviewed_doc_objects' as src_table
	from
		blobs.v_reviewed_doc_objects vrdo


	union all	-- patient tags
	select
		d_vit.pk_identity
			as pk_patient,
		's' as soap_cat,
		d_vit.l10n_description
			|| coalesce(' ' || d_vit.comment, '')
			as narrative,
		null
			as pk_encounter,
		null
			as pk_episode,
		null
			as pk_health_issue,
		d_vit.pk_identity_tag
			as src_pk,
		'dem.v_identity_tags'
			as src_table
	from
		dem.v_identity_tags d_vit


	union all	-- external care
	select
		c_vec.pk_identity
			as pk_patient,
		's' as soap_cat,
		case
			when c_vec.pk_health_issue is null then
				coalesce(c_vec.issue, '')
				|| coalesce(' / ' || c_vec.provider, '')
				|| coalesce(' / ' || c_vec.comment, '')
			else
				coalesce(c_vec.provider, '')
				|| coalesce(' / ' || c_vec.comment, '')
		end as narrative,
		c_vec.pk_encounter
			as pk_encounter,
		null
			as pk_episode,
		c_vec.pk_health_issue
			as pk_health_issue,
		c_vec.pk_external_care
			as src_pk,
		'clin.v_external_care'
			as src_table
	from
		clin.v_external_care c_vec


	union all	-- export items
	select
		c_vei.pk_identity
			as pk_patient,
		's' as soap_cat,
		case
			when c_vei.pk_doc_obj is null then
				coalesce(c_vei.description, '')
				|| coalesce(' / ' || c_vei.filename, '')
			else
				coalesce(c_vei.description, '')
		end as narrative,
		null
			as pk_encounter,
		null
			as pk_episode,
		null
			as pk_health_issue,
		c_vei.pk_export_item
			as src_pk,
		'clin.v_export_items'
			as src_table
	from
		clin.v_export_items c_vei


	union all	-- hint suppression rationale
	select
		(select fk_patient from clin.encounter where pk = c_sh.fk_encounter)
			as pk_patient,
		'p' as soap_cat,
		c_sh.rationale
			as narrative,
		c_sh.fk_encounter
			as pk_encounter,
		null
			as pk_episode,
		null
			as pk_health_issue,
		c_sh.pk
			as src_pk,
		'clin.suppressed_hint'
			as src_table
	from
		clin.suppressed_hint c_sh

) as union_table

where
	trim(coalesce(union_table.narrative, '')) != ''
;
"""

def search_text_across_emrs(search_term=None):

	if search_term is None:
@@ -506,9 +909,14 @@ def search_text_across_emrs(search_term=None):
	if search_term.strip() == u'':
		return []

	cmd = u'select * from clin.v_narrative4search where narrative ~* %(term)s order by pk_patient limit 1000'
	rows, idx = gmPG2.run_ro_queries(queries = [{'cmd': cmd, 'args': {'term': search_term}}], get_col_idx = False)

	#cmd = u'select * from clin.v_narrative4search where narrative ~* %(term)s order by pk_patient limit 1000'
	#rows, idx = gmPG2.run_ro_queries(queries = [{'cmd': cmd, 'args': {'term': search_term}}], get_col_idx = False)
	cmd = u'select * from v_narrative4search where narrative ~* %(term)s order by pk_patient limit 1000'
	queries = [
		{'cmd': __VIEW_DEF},
		{'cmd': cmd, 'args': {'term': search_term}}
	]
	rows, idx = gmPG2.run_rw_queries(queries = queries, get_col_idx = True, return_data = True)
	return rows

#============================================================
+6 −2
Original line number Diff line number Diff line
@@ -97,6 +97,7 @@
    <li> <strong class="uidlink"><a href="Gnumed.business.gmExternalCare-module.html">Gnumed.business.gmExternalCare</a></strong>: <em class="summary">GNUmed external care classes.</em>    </li>
    <li> <strong class="uidlink"><a href="Gnumed.business.gmFamilyHistory-module.html">Gnumed.business.gmFamilyHistory</a></strong>: <em class="summary">GNUmed family history handling middleware</em>    </li>
    <li> <strong class="uidlink"><a href="Gnumed.business.gmForms-module.html">Gnumed.business.gmForms</a></strong>: <em class="summary">GNUmed forms classes</em>    </li>
    <li> <strong class="uidlink"><a href="Gnumed.business.gmGenericEMRItem-module.html">Gnumed.business.gmGenericEMRItem</a></strong>: <em class="summary">GNUmed clinical business object in generic form.</em>    </li>
    <li> <strong class="uidlink"><a href="Gnumed.business.gmHL7-module.html">Gnumed.business.gmHL7</a></strong>: <em class="summary">Some HL7 handling.</em>    </li>
    <li> <strong class="uidlink"><a href="Gnumed.business.gmIncomingData-module.html">Gnumed.business.gmIncomingData</a></strong>: <em class="summary">Handling of &lt;INCOMING&gt; area.</em>    </li>
    <li> <strong class="uidlink"><a href="Gnumed.business.gmKVK-module.html">Gnumed.business.gmKVK</a></strong>: <em class="summary">GNUmed German KVK/eGK objects.</em>    </li>
@@ -705,7 +706,6 @@
    <li> <strong class="uidlink"><a href="Gnumed.wxGladeWidgets.wxgBillingPluginPnl-module.html">Gnumed.wxGladeWidgets.wxgBillingPluginPnl</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Gnumed.wxGladeWidgets.wxgCardiacDevicePluginPnl-module.html">Gnumed.wxGladeWidgets.wxgCardiacDevicePluginPnl</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Gnumed.wxGladeWidgets.wxgCommChannelEditAreaPnl-module.html">Gnumed.wxGladeWidgets.wxgCommChannelEditAreaPnl</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Gnumed.wxGladeWidgets.wxgCreatePatientMediaDlg-module.html">Gnumed.wxGladeWidgets.wxgCreatePatientMediaDlg</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Gnumed.wxGladeWidgets.wxgCurrentMedicationEAPnl-module.html">Gnumed.wxGladeWidgets.wxgCurrentMedicationEAPnl</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Gnumed.wxGladeWidgets.wxgCurrentSubstancesPnl-module.html">Gnumed.wxGladeWidgets.wxgCurrentSubstancesPnl</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Gnumed.wxGladeWidgets.wxgDataMiningPnl-module.html">Gnumed.wxGladeWidgets.wxgDataMiningPnl</a></strong>    </li>
@@ -726,7 +726,9 @@
    <li> <strong class="uidlink"><a href="Gnumed.wxGladeWidgets.wxgEncounterTypeEditAreaPnl-module.html">Gnumed.wxGladeWidgets.wxgEncounterTypeEditAreaPnl</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Gnumed.wxGladeWidgets.wxgEpisodeEditAreaPnl-module.html">Gnumed.wxGladeWidgets.wxgEpisodeEditAreaPnl</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Gnumed.wxGladeWidgets.wxgExamplePluginPnl-module.html">Gnumed.wxGladeWidgets.wxgExamplePluginPnl</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Gnumed.wxGladeWidgets.wxgExportAreaExportToMediaDlg-module.html">Gnumed.wxGladeWidgets.wxgExportAreaExportToMediaDlg</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Gnumed.wxGladeWidgets.wxgExportAreaPluginPnl-module.html">Gnumed.wxGladeWidgets.wxgExportAreaPluginPnl</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Gnumed.wxGladeWidgets.wxgExportAreaSaveAsDlg-module.html">Gnumed.wxGladeWidgets.wxgExportAreaSaveAsDlg</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Gnumed.wxGladeWidgets.wxgExternalCareEAPnl-module.html">Gnumed.wxGladeWidgets.wxgExternalCareEAPnl</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Gnumed.wxGladeWidgets.wxgExternalIDEditAreaPnl-module.html">Gnumed.wxGladeWidgets.wxgExternalIDEditAreaPnl</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Gnumed.wxGladeWidgets.wxgFamilyHistoryEAPnl-module.html">Gnumed.wxGladeWidgets.wxgFamilyHistoryEAPnl</a></strong>    </li>
@@ -811,6 +813,7 @@
    </li>
    <li> <strong class="uidlink"><a href="Gnumed.wxpython-module.html">Gnumed.wxpython</a></strong>
    <ul>
    <li> <strong class="uidlink">Gnumed.wxpython.gmAMTS_BMPWidgets</strong>    </li>
    <li> <strong class="uidlink"><a href="Gnumed.wxpython.gmATCWidgets-module.html">Gnumed.wxpython.gmATCWidgets</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Gnumed.wxpython.gmAU_VaccV01-module.html">Gnumed.wxpython.gmAU_VaccV01</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Gnumed.wxpython.gmAbout-module.html">Gnumed.wxpython.gmAbout</a></strong>    </li>
@@ -847,6 +850,7 @@
    <li> <strong class="uidlink"><a href="Gnumed.wxpython.gmFormWidgets-module.html">Gnumed.wxpython.gmFormWidgets</a></strong>: <em class="summary">GNUmed form/letter handling widgets.</em>    </li>
    <li> <strong class="uidlink"><a href="Gnumed.wxpython.gmGP_HabitsRiskFactors-module.html">Gnumed.wxpython.gmGP_HabitsRiskFactors</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Gnumed.wxpython.gmGP_SocialHistory-module.html">Gnumed.wxpython.gmGP_SocialHistory</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Gnumed.wxpython.gmGenericEMRItemWorkflows-module.html">Gnumed.wxpython.gmGenericEMRItemWorkflows</a></strong>: <em class="summary">GNUmed generic clinical item business object workflows.</em>    </li>
    <li> <strong class="uidlink"><a href="Gnumed.wxpython.gmGuiHelpers-module.html">Gnumed.wxpython.gmGuiHelpers</a></strong>: <em class="summary">GNUmed GUI helper classes and functions.</em>    </li>
    <li> <strong class="uidlink"><a href="Gnumed.wxpython.gmGuiMain-module.html">Gnumed.wxpython.gmGuiMain</a></strong>    </li>
    <li> <strong class="uidlink"><a href="Gnumed.wxpython.gmHabitWidgets-module.html">Gnumed.wxpython.gmHabitWidgets</a></strong>: <em class="summary">GNUmed habits widgets.</em>    </li>
@@ -1014,7 +1018,7 @@
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1
    on Fri Jan 25 02:55:27 2019
    on Sun Jul 28 01:55:29 2019
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
Loading