FHIR Chat · Patient search - active · implementers

Stream: implementers

Topic: Patient search - active


view this post on Zulip John Moehrke (Apr 07 2017 at 17:20):

What is the Patient search behavior when the client does not include the 'active' query parameter? Does this imply only active Patient resources should be queried? It would seem otherwise all queries on Patient must most of the time indicate active as not false.

view this post on Zulip David Hay (Apr 07 2017 at 19:26):

I would assume that if not specified in the query, then both active & inactive Patients would be returned, and it would be up to the client to process them...

view this post on Zulip Lloyd McKenzie (Apr 08 2017 at 00:05):

In theory a server could "add" a default filter, but if they were doing so they'd have to declare it. And I would generally consider that poor practice

view this post on Zulip John Moehrke (Apr 09 2017 at 16:48):

well, there is a problem... I don't disagree with either of your answers... but, it is indeed a problem.... SO IHE PDQm would now need to specify the use of this query parameter... and everyone should be careful of the results they get back, as they might be getting back something that is not active.

view this post on Zulip John Moehrke (Apr 09 2017 at 16:49):

especially true if the server doesn't support the active query parameter....

view this post on Zulip Jens Villadsen (Apr 09 2017 at 21:49):

Well ... you always need to be careful. Regardless, the value of the attribute is reflected on each of the patient resources returned

view this post on Zulip John Moehrke (Apr 10 2017 at 12:54):

I think this is especially problematic when the element isModifier true.

view this post on Zulip Elliot Silver (Apr 10 2017 at 16:21):

Is this any different from other searches which could return entered-in-error or completed resources?

view this post on Zulip Jenni Syed (Apr 10 2017 at 17:18):

In our fhir implementation, we would NOT return inactive in any resource (this is logically different than "entered in error") since this is essentially resources that have been logically deleted

view this post on Zulip Jenni Syed (Apr 10 2017 at 17:19):

if you read by id, and it's inactive, we reference the record that replaced this patient

view this post on Zulip Jenni Syed (Apr 10 2017 at 17:20):

but wouldn't return any other data about that patient, since it should no longer be used anywhere

view this post on Zulip Jenni Syed (Apr 10 2017 at 17:23):

This is probably something that should be on the safety checklist? I know it applies to patient - and likely other resources that have the concept of active vs inactive

view this post on Zulip John Moehrke (Apr 10 2017 at 17:37):

@Jenni Syed so, then you interpret a missing query parameter for active, to be a request for those that are not inactive? I think this is logical, but not obvious. Coming from DSTU2, this active modifier is new, and now (STU3) seems the active parameter is about as close to a required query parameter as there is...

view this post on Zulip Jenni Syed (Apr 10 2017 at 17:38):

We do not support that query parameter at all

view this post on Zulip Jenni Syed (Apr 10 2017 at 17:39):

which is documented both on our readable doc and conformance/capability

view this post on Zulip Jenni Syed (Apr 10 2017 at 17:40):

Again, I think this is closer to what most systems would do when something is logically deleted - you wouldn't normally expect to get those items back when, say, the reg nurse queries by name

view this post on Zulip John Moehrke (Apr 10 2017 at 17:50):

deleted is different than active=false... deleted is a CRUD operation, and part of version lifecycle. active element is somehow different. I am confused on how it is different, but it has shown up in STU3.

view this post on Zulip John Moehrke (Apr 10 2017 at 17:50):

by 'not support', that would mean you would ignore gracefully if a client included the active parameter... right?

view this post on Zulip Jenni Syed (Apr 10 2017 at 17:52):

Correct, though in STU 3 there's also the Prefer header where someone could tell us to fail :)

view this post on Zulip Jenni Syed (Apr 10 2017 at 17:53):

Still feels like this is part of the safety checklist... @Grahame Grieve - Thoughts on above?

view this post on Zulip John Moehrke (Apr 10 2017 at 18:00):

wow, thanks for more lessons-learned... prefer header seems useful, but also seems rather dangerous...

view this post on Zulip John Moehrke (Apr 10 2017 at 18:00):

I do agree, safety checklist material

view this post on Zulip Grahame Grieve (Apr 15 2017 at 21:38):

well, the lifecycle page says that active = false *is* the same as entered-in-error.

view this post on Zulip Grahame Grieve (Apr 15 2017 at 21:40):

it's really problematic for clients when servers omit results by default - how do you get them not to be omitted? But it's also really problematic for clients when some servers don't support search parameters, and others do, and it matters.

I think this is more than a afety check list issue - we probably need special rules about search parameters on entered-in-error linked search parameters to enable safe consistency

view this post on Zulip John Moehrke (Apr 17 2017 at 12:00):

Yes, @Grahame Grieve you understand my concern...

view this post on Zulip Jenni Syed (Apr 17 2017 at 14:06):

To add some context: we're already finding that apps which don't search on status/aren't filtering on status are also often NOT handling entered-in-error

view this post on Zulip Jenni Syed (Apr 17 2017 at 14:06):

IE: they display an observation result or use it as if it's accurate even when the status is errored.

view this post on Zulip Jenni Syed (Apr 17 2017 at 14:07):

However, a physician seeing a result that was once active/valid and could have been used in clinical checking seems like a more necessary case than a physician needing to see an inactive/combined away patient that they can't use for anything, and shouldn't have any clinical data associated anymore

view this post on Zulip Jenni Syed (Apr 17 2017 at 14:08):

(again, if an app has the patient context already, and reads it by id, they will get the inactive patient with the link to the replacement)

view this post on Zulip Grahame Grieve (Apr 17 2017 at 19:03):

so these apps are non-conformant. But agree that we need to do more about this

view this post on Zulip John Moehrke (Apr 18 2017 at 12:14):

The example on the Search page includes
GET [base]/Patient?active=true
is that always going to work? What about when the active element is empty?
is it better to use
GET [base]/Patient?active:not=false
is that going to work where versioning is used and the DELETE operation has deleted it?

view this post on Zulip Lloyd McKenzie (Apr 18 2017 at 15:35):

@John Moehrke Patient.active has a default, so if it's empty, the presumed value is 'true'. It's not supported to have Patient.active be unknown

view this post on Zulip John Moehrke (Apr 18 2017 at 15:39):

@Lloyd McKenzie that is a valid point. putting much faith in servers implementation of ramifications of defaults... okay... It still seems active:not=false is more safe for a client.

view this post on Zulip Lloyd McKenzie (Apr 18 2017 at 15:40):

If the server supports the ":not" qualifier

view this post on Zulip John Moehrke (Apr 18 2017 at 15:41):

oh, great... 'not' good

view this post on Zulip John Moehrke (Apr 18 2017 at 15:42):

so.. more likely active=true will work then...

view this post on Zulip Lloyd McKenzie (Apr 18 2017 at 15:50):

Correct

view this post on Zulip Grahame Grieve (Apr 18 2017 at 21:01):

has someone created a task to make sure we address this?

view this post on Zulip Lloyd McKenzie (Apr 18 2017 at 21:13):

Address it how?

view this post on Zulip Grahame Grieve (Apr 18 2017 at 21:15):

at least document it well, including in the safety check list.. Possible introduce a conformance criteria on these search parameters that requires server implementers to do more safety related checking, and encourages clients to consider it

view this post on Zulip Lloyd McKenzie (Apr 19 2017 at 02:12):

GF#13216, though I think the real safety issue is about other "entered in error" issues. Accidentally retrieving a non-active patient is unlikely to result in any patient safety issues I can think of.

view this post on Zulip Yunwei Wang (Apr 19 2017 at 16:17):

Back to @John Moehrke original question about searching patient without "active" search parameter. From the discussion above, my understanding is that if "active" parameter is not present, server should treat the search as "active=true". Is my understanding correct?

view this post on Zulip John Moehrke (Apr 19 2017 at 16:47):

right... it is understood what the default of the element is... but what is the default of the parameter when it isn't included in a search...

view this post on Zulip Grahame Grieve (Apr 19 2017 at 20:20):

no. The active element defaults to false. But the active search parameter doesn't, and servers should treat search as search on any value of active if active is not specified

view this post on Zulip Elliot Silver (Apr 19 2017 at 20:41):

Actually, the Patient.active element defaults to true.

view this post on Zulip Grahame Grieve (Apr 19 2017 at 20:49):

sorry, typo - not paying quite enough attention there

view this post on Zulip Elliot Silver (Apr 19 2017 at 20:54):

By the way, how do defaults work in the presence of extensions? Is there a difference between:

<Patient>
 ...
 <active>
    <extension url="http://someURL..." >
       <valueDate value="20171511" />
   </extension>
 </active>
</Patient>

and

<Patient>
 ...
 <active value="true">
    <extension url="http://someURL..." >
       <valueDate value="20171511" />
   </extension>
 </active>
</Patient>

Do both match a search for active=true?

view this post on Zulip Lloyd McKenzie (Apr 19 2017 at 20:57):

My opinion is that both would be the same, but clarification would be good. Would you mind submitting a change request?

view this post on Zulip Grahame Grieve (Apr 19 2017 at 20:57):

those are different, but both match for search active=true

view this post on Zulip Elliot Silver (Apr 19 2017 at 20:59):

I can see rationale for either part of your statement, Grahame, but I'm not sure they make sense together.

view this post on Zulip Grahame Grieve (Apr 19 2017 at 21:06):

they are different in respects other than searching

view this post on Zulip Elliot Silver (Apr 19 2017 at 21:11):

GF#13224 filed.

view this post on Zulip John Moehrke (Apr 20 2017 at 11:52):

I understand the explanation for active. This means that for any real use of the Patient resource, the active=true will be a mandatory parameter, unless you really want inactive entries too (which is less likely).

view this post on Zulip Brian Postlethwaite (Apr 26 2017 at 03:49):

Wondering if the fhirpath data extraction expression should be updated for this also? Or is that some logic that need to know elsewhere.

view this post on Zulip Brian Postlethwaite (Apr 26 2017 at 03:50):

Was thinking something like (Patient.active | true).first() but that doesn't work if there is no value, and just an extension as the example given above has.

view this post on Zulip Brian Postlethwaite (Apr 26 2017 at 03:59):

I guess it could be iif(active.hasValue(), active, true)

view this post on Zulip Grahame Grieve (Apr 28 2017 at 00:49):

you could make a task for this; right now, there's no support for doing something like that in teh build

view this post on Zulip Elliot Silver (Oct 24 2017 at 17:31):

GF#13339 and GF#13224 are still open on this issue. Has there been any further discussion since Madrid? It seems this is something that will have to be nailed down for a normative release.


Last updated: Apr 12 2022 at 19:14 UTC