I have a simple report that returns all patients who have an entry in a certain obsterm.
it looks something like:
{PERSON.DATEOFBIRTH} <= DateTime (1954, 04, 01, 00, 00, 00) and
{OBSHEAD.NAME} = "AD DISCUSSED" and
{RPTOBS.CHANGE} = 2.00
I changed it to return patients who have no entries in the AD DISCUSSED field:
{PERSON.DATEOFBIRTH} <= DateTime (1954, 04, 01, 00, 00, 00) and
{OBSHEAD.NAME} = "AD DISCUSSED" and
{RPTOBS.CHANGE} = 2.00 and
isnull({RPTOBS.OBSVALUE})
but the report returns nothing. Any pointers on how to capture patients with no entry? In EMR 9.5 it is as simple as saying 'AD DISCUSSED' is blank.
Are you trying to find patients where:
1) AD DISCUSSED was written, but with a blank value,
or
2) AD DISCUSSED was never written
I am trying to do something like the following:
The obshead.name = "AD DISCUSSED" and
rptobs.obsvalue = " "
does that make sense? Nothing is written to the "AD DISCUSSED" field, but the field exists.
So, if you run a report for "AD DISCUSSED", do you get any patients? Start with that report. Do this:
{PERSON.DATEOFBIRTH} <= DateTime (1954, 04, 01, 00, 00, 00) and
{OBSHEAD.NAME} = "AD DISCUSSED" and
{RPTOBS.CHANGE} = 2.00
displaying all the important fields.
If you can see 'blanks' for the OBSVALUE of some records, then you can try to trap for it. Beware that a null field is not the same as a field that is equal to " ".
Yes, that returns all the patients age 60 and over who have an entry in "AD DISCUSSED"
Does a similar code not work for you? It seems like a standard query to return values from a specific observation term {OBSHEAD.NAME} = "AD DISCUSSED" in a given field but restrict it to patients over the age of 60 {PERSON.DATEOFBIRTH} <= DateTime (1954, 04, 01, 00, 00, 00) and values that have been 'signed' {RPTOBS.CHANGE} = 2.00.
I do not use that field, and I don't know what you have in the field when you think it is blank.
If you can see the records in your current report while not trying to use an 'isnull' or other, perhaps try a 'len()' function and look for a 0 (zero).
I believe this can easily be done using subreports. In the main report, use the PERSON table and give the condition to check for age. In the sub report, use RPTOBS and OBSHEAD tables, give the conditions
{OBSHEAD.NAME} = "AD DISCUSSED" and
{RPTOBS.CHANGE} = 2.00
Link the main report to the subreport by PID.
Hope this helps.
Joseph,
I am not familiar with len(), could you write an example of how the function works?
Baj,
Your subreport advice worked pretty well. My formatting is a little screwy, but the null values seem to be posting!
Thanks so much, both of you!!!