You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
_logger.LogInformation("Started PatientIdsAcquired consumer for topic '{Topic}' at {StartTime}",nameof(KafkaTopic.PatientListsAcquired),DateTime.UtcNow);
72
+
_logger.LogInformation("Started PatientListsAcquired consumer for topic '{Topic}' at {StartTime}",nameof(KafkaTopic.PatientListsAcquired),DateTime.UtcNow);
To discharge a patient and begin their reporting workflow, produce the same `PatientIDsAcquired` event without the discharged patient in the list. The example below will discharge `Patient/0VmZaB90pc5yRSefoK6sW9C9WVOvPARAgquBFNtGr6LXk`:
162
+
To discharge a patient and begin their reporting workflow, produce the same `PatientListsAcquired` event without the discharged patient in the list. The example below will discharge `Patient/0VmZaB90pc5yRSefoK6sW9C9WVOvPARAgquBFNtGr6LXk`:
Acquisition-->>Kafka: Produce - PatientIDsAcquired()
211
-
Kafka->>Census: Consume - PatientIDsAcquired()
257
+
Acquisition-->>Kafka: Produce - PatientListsAcquired()
258
+
Kafka->>Census: Consume - PatientListsAcquired()
212
259
Census->>Census: Persist and admit patient ID’s from the consumed list()
213
260
Census->>Census: Discharge patients who were admitted and are no longer on the consumed list()
214
261
Census-->>Kafka: Produce - PatientEvent(discharge)
@@ -218,11 +265,11 @@ sequenceDiagram
218
265
Acquisition->>Acquisition: Schedules a lag time before querying for patient resources()
219
266
```
220
267
221
-
During the reporting period, the Census service is configured to continually request a new list of patients admitted in a facility by producing the `CensusAcquisitionScheduled` event. The Data Acquisition service consumed this event and queries the facility's List endpoint. After receiving a response back from the EHR endpoints, the Data Acquisition service then produces a `PatientIDsAcquired` event that contains a list of all patients that are currently admitted in the facility.
268
+
During the reporting period, the Census service is configured to continually request a new list of patients admitted in a facility by producing the `CensusAcquisitionScheduled` event. The Data Acquisition service consumed this event and queries the facility's List endpoint. After receiving a response back from the EHR endpoints, the Data Acquisition service then produces a `PatientListsAcquired` event that contains a list of all patients that are currently admitted in the facility.
222
269
223
-
The Census service consumes the `PatientIDsAcquired` event and applies updates in the database for patients have been admitted or discharged.
270
+
The Census service consumes the `PatientListsAcquired` event and applies updates in the database for patients have been admitted or discharged.
224
271
225
-
> Note: The Census service treats any patient in the PatientIDsAcquired list as an admitted patient. If the Census service has a patient marked as admitted in the database, but the patient is no longer present on the consumed list, it treats the patient as a discharge.
272
+
> Note: The Census service treats any patient in the PatientListsAcquired list as an admitted patient. If the Census service has a patient marked as admitted in the database, but the patient is no longer present on the consumed list, it treats the patient as a discharge.
226
273
227
274
A `PatientEvent` Kafka message is produced for each patient that has been discharged.
Copy file name to clipboardExpand all lines: docs/domains/Tenant/services/CensusService/index.mdx
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,12 +45,12 @@ The system routinely gathers census data by leveraging multiple methods compatib
45
45
46
46
## Event Sourcing Workflow
47
47
48
-
The Census service consumes `PatientIDsAcquired` events from Kafka. When a new event is received, the `PatientListsAcquiredListener` processes the payload, updating census records for the specified facility. This enables downstream reporting and data acquisition.
48
+
The Census service consumes `PatientListsAcquired` events from Kafka. When a new event is received, the `PatientListsAcquiredListener` processes the payload, updating census records for the specified facility. This enables downstream reporting and data acquisition.
49
49
50
50
**Workflow Steps:**
51
51
1.**Scheduling:** A scheduled job (per tenant configuration) triggers a request for updated patient lists.
52
52
2.**Data Acquisition:** The system sends a `DataAcquisitionRequested` event, prompting the acquisition of FHIR patient lists.
53
-
3.**Event Production:** Upon successful acquisition, a `PatientIDsAcquired` event is produced, containing the list of patient FHIR IDs.
53
+
3.**Event Production:** Upon successful acquisition, a `PatientListsAcquired` event is produced, containing the list of patient FHIR IDs.
54
54
4.**Census Update:** The Census service consumes the event and updates its records accordingly.
55
55
56
56
## Event Payload Structures
@@ -536,6 +536,10 @@ The **FHIR List Resource** method is one of the primary approaches for acquiring
536
536
-**Functionality**: Queries the EHR for patient lists identified by a `listId`.
537
537
-**Tenant Configurability**: The `listId` is configurable per tenant within Link, allowing each institution to define the patient population that constitutes their census.
538
538
-**Applicability**: This method supports census management for any EHR that utilizes FHIR Lists representing relevant patient groups.
539
+
-**Rules**: The following rules are enforced by Census when processing FHIR List resources:
540
+
- Admission lists are processed before discharge lists.
541
+
- If a patient appears on a discharge lists with no corresponding admit event, an admission event is created and then the patient is discharged.
542
+
- If a patient is admitted and then disappears off of all incoming lists, the patient is discharged.
539
543
540
544
#### 2. FHIR Standard - Bulk FHIR Implementation Guide
0 commit comments