EMR Integration Use Cases (EMR)¶
UC-EMR-201: Save Transcript + Structured Note¶
Purpose: Persist the generated artifacts in the local patient bundle.
| Property | Value |
|---|---|
| Actor | Persistence Service |
| Trigger | Note Finalized |
| Priority | P0 |
Main Success Scenario:
1. Receive clean transcript and SOAP JSON
2. Generate unique Encounter ID
3. Store in Document Store (MongoDB/Postgres) linked to Patient
4. Index for search
5. Return success acknowledgement
Acceptance Criteria: 1. [ ] ACID compliance for writes 2. [ ] Data encrypted at rest 3. [ ] Version control for note edits
UC-EMR-202a: Link Patient Identity¶
Purpose: Match the local patient context to the remote EMR patient ID.
| Property | Value |
|---|---|
| Actor | Integration Service |
| Trigger | Before Push |
| Priority | P0 |
Main Success Scenario:
1. Query EMR Patient Search API with Demographics + Mobile
2. Calculate match score (Fuzzy matching)
3. If exact match, retrieve EMR `PatientID`
4. If multiple matches, prompt user to select
5. If no match, call `CreatePatient` on EMR
Acceptance Criteria: 1. [ ] False positive match rate < 0.01% 2. [ ] Caches links for future encounters
UC-EMR-202b: Push Clinical Artifacts¶
Purpose: Submit the final note and structured data to the EMR.
| Property | Value |
|---|---|
| Actor | Integration Service |
| Trigger | Identity Linked |
| Priority | P0 |
Main Success Scenario:
1. Construct FHIR Bundle (Composition, Encounter, Observation)
2. Set `subject` reference to EMR `PatientID`
3. POST transaction to EMR FHIR Endpoint
4. Verify transaction commit status
5. Store EMR-assigned `EncounterID` locally
Acceptance Criteria: 1. [ ] Handles partial failures (transaction rollback) 2. [ ] Supports PDF attachment as fallback
UC-EMR-203: Create Encounter & Audit Trail¶
Purpose: Maintain a legal record of the interaction.
| Property | Value |
|---|---|
| Actor | Audit Service |
| Trigger | EMR Push Success |
| Priority | P0 |
Main Success Scenario:
1. Log "Encounter Created" event
2. Capture Doctor Signature (Digital Sign/Timestamp)
3. Hash the final note content for integrity
4. Store audit record (Who, What, When, Hash)
5. Make available for medico-legal review
Acceptance Criteria: 1. [ ] Tamper-evident logs 2. [ ] timestamps synchronized to NTP 3. [ ] Signature non-repudiation