[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnumed-devel] Report generator query for current patient medication
From: |
Jim Busser |
Subject: |
Re: [Gnumed-devel] Report generator query for current patient medication and lab results |
Date: |
Sun, 28 Aug 2011 13:14:23 -0700 |
On 2011-05-09, at 9:50 AM, Karsten Hilbert wrote:
> On Thu, May 05, 2011 at 08:07:02AM -0700, Jim Busser wrote:
>
>> Does the GNUmed / Postgres code specify a handle for the current patient
>
> At what level ?
>
> One could do:
>
> import gmPerson
> gmPerson.gmCurrentPatient()
>
>> and can a query be provided that could do the following
>>
>> For the current patient
>>
>> select dosages of warfarin (INN B01AA03) and dates used
>> where the dates have been within the most recent 16 weeks
>
> Since we don't track dosages on a day-by-day basis that
> could only be extrapolated but that is possible, assuming
> the doctor uses some convention when documenting the current
> OAC intake schedule.
>
>> select also the values for the INR lab test LOINC = "34714-6"
>> where the dates have been within the most recent 16 weeks
>
> That is easily possible.
>
>> fields of interest: patient name, dob, sex, date/time, dosage, INR
>>
>> idea is to eventually gnuplot them however not sure how easy or had to
>> designate (from the report generator) the axes and the columns
>
> They can simply be picked from the list of columns the query returns.
>
>> There is also of course the question of changing dosages
>> over time when they did no longer exist as current
>> medications, so I am not sure whether the selection would
>> have to combine data from the current medication table and
>> the audit table of no-longer-current medications?
>
> It would (have to combine), yes. In that it would have to
> also take into account that schedules documented in those
> entries need to be carefully applied to actual time ranges
> since we usually change dosages somewhere mid-schedule.
>
> Karsten
More basically, if the current patient happened to have pk = 12 it is possible
to have a query in which one can specify
where pk_patient = 12
however even when this query is saved (e.g. with report name
XXXXX for current patient
one cannot use it for any other patient until one would manually insert the pk
for whomever would be this patient. So I am wondering whether GNUmed has a
placeholder or syntax which could be saved in a query which would limit the
matches to the rows which pertain to the current patient?
-- Jim
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Gnumed-devel] Report generator query for current patient medication and lab results,
Jim Busser <=