GNUmed dynamic hint problem

Karsten Hilbert <[email protected]> Thu, 26 Nov 2015 11:43:52 +0100
Newsgroups gmane.comp.gnu.medical.announce
Message-ID <20151126104351.GC4221__38481.6075944856$1448534718$gmane$org@hermes.hilbert.loc>
For people being haunted by GNUmed telling them to wean off
ACEI/Sartans supposedly pregnant women find below an updated
dynamic hint query:

	SELECT EXISTS (
		SELECT 1 FROM clin.v_substance_intakes WHERE
			pk_patient = ID_ACTIVE_PATIENT
				AND
			(
				substance ~* ''.*sartan.*''
					OR
				substance ~* ''.*angiotensin.*''
					OR
				substance ~ ''.*ACE.*''
					OR
				substance ~* ''.*pril.*''
					OR
				atc_brand ~* ''^C09.*''
					OR
				atc_substance ~* ''^C09.*''
			)
	) AND EXISTS (
		SELECT 1 FROM clin.v_narrative4search WHERE
			pk_patient = ID_ACTIVE_PATIENT
				AND
			narrative ~* ''.*schwanger.*''
	);

It turned out said query lacked a pair of parentheses around
the ORed substance selections.

To use the above go to menu

	GNUmed
		Manage lists
			edit list "Dynamic hints"
				edit hint "Kontraindikation: ACE/Sartan <-> Schwangerschaft"

and post the above SQL into the "Query/SQL" field.

If you aren't interested in this hint you can just as well
disable it, too.

GNUmed 1.6 will contain a much improved hint based on
documented EDC rather than relying on the narrative
containing the fragment "schwanger" (roughly translates to
"pregna").

Best,
Karsten
-- 
GPG key ID E4071346 @ eu.pool.sks-keyservers.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346