Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Describe how to query ward encounters #37

Merged
merged 8 commits into from
Jan 31, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions input/pagecontent/StructureDefinition-fi-base-encounter-intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
### Scope and Usage


### How to find a patient in a ward?

Many systems have a need to answer the question: "How to find patients/encounters that are at ward
X at moment T?".

There are key points to consider when forming the search criteria:
* We are most likely interested only in `IMP` (inpatient encounter) encounters, so we should filter by `class`.
* We are interested only in `in-progress` encounters, so we need to filter by `status`.
* We are most likely interested in querying by organizational hierarchy, the organizational unit (ward) responsible for the patient (not physical location).

Organizational ward should be stored in `serviceProvider`.

FHIR request parameters:
`GET /Encounter`
* class = `IMP`
* status = `in-progress`
* period `gt` and `le` -filters as per target moment
* serviceProvider = id of the ward organization resource

Historically some systems keep the ward encounter active when the patient is sent to ICU. Leaving
the encounter in an `in-progress` state would cause a gotcha: encounter says that it's active but
patient is not really there. Using encounter´s `location` elements could be used to express that
the patient has no active location in the ward, but this might be difficult to process for client
systems and depend heavily on the organizational and location structures of a facility. Because of
these problems, the encounter should not be kept `in-progress` when the patient is in an ICU period
(if there is a need for "recycling" the ward period encounter, it should be set to `finished` and
then back to `in-progress` upon return from the ICU).

#### Why not use Location.managingOrganization?
`Encounter`s `location` -field is a reference to `Location` that has a field
`managingOrganization`. Use of this to find the organization responsible for the patient is
problematic. `Location.managingOrganization` might change for different reasons (a room is
assigned to another organization) and this would have an unexpected effect on the
responsibility-concern. `Location.managingOrganization` is "too far" from the encounter to be
useful in this context.

#### Querying by physical location
Querying by location is also an option. Here the focus is on the physical location and not the
organizational responsibility towards the patient. [This blog post](https://fhirblog.com/2013/10/24/adventures-in-searching-getting-a-list-of-patients-in-a-ward/)
will describe the process.