Download presentation
Presentation is loading. Please wait.
Published byKevin Guthrie Modified over 10 years ago
0
Domain Driven Design and Event Sourcing with RIM
1
Introduction RIMResistance is Futile, you Will be Assimilated!
2
Introduction DDD and Event Sourcing George de la Torre
Developer of custom clinical apps For a long time Discovered RIM a long time ago… Oleg Sitalo (silent partner) Developer of custom clinical apps For a long time together Believes in RIM, at occasions…
3
Agenda DDD and Event Sourcing Google will find heaps of stuff on this
Will focus on the RIM stuff Great resources for DDD/ES Implementing Doman-Driven Design Vaughn Vernon Domain Driven Design (the Blue Book) Eric Evans
4
Domain Driven Design DDD and Event Sourcing Object Oriented Model
Business needs & language captured HL7 v3 RIM benefits Design done! – the hardest part Standard – open & shared to all Deep insights into domain knowledge Integration of domains built in (No barriers!) Reuse logic across clinical domains
5
Domain Model Blueprint for all Aggregates
HL7 V3 RIM
6
Supporting Domains External Services
Vocabulary Bounded Contexts
7
Supporting Domains External Services
Anti Corruption Layer Other systems or Big Ball of Mud… Business Process and Rules Engines Point: This layer keeps RIM pure!
8
Event Sourcing DDD and Event Sourcing
Only the Aggregate (D-MIM) is persisted The command is saved (Behavior) Aggregates publishes the events Command Query Responsibility Segregation (CQRS) Command (Transaction) Model Query Model
9
Patient Dashboard Example Use Case
Schedule a patient visit Find Patient (Query Model) View Calendar (Query Model) Patient assigned time slot (Command) CreateAppointmentCommand(data) executes Scheduling aggregate is created from data The created aggregate is appended Publishes event to update Query Model
10
Scheduling Aggregate Example
11
Scheduling Aggregate CMET (PAT) is the Root
12
Considerations Scheduling Aggregate Entity is usually the Root
No cloning, only class codes Aggregates varies with the RIM set Act may be the Root (Strategy) Reference others Aggregates (Observations) Act Mood partitioning PHI segregation requirement (Query model too) Performance
13
Considerations continued…
Scheduling Aggregate Considerations continued… Serialized, XML, JSON, etc… Relational Database (SQL) Cache based systems File systems NoSQL Natural for event stores Easier to query Aggregates if needed Aggregates loaded for logic on command
14
Scheduling Aggregate Appended
CreateAppointmentCommand(data) Event Store ID Name Version Data 1 Schedule 1.2 2 3
15
Scheduling Aggregate Publishes Events
AppointmentCreatedEvent(data) { UpdateDatabaseView() } Query model MRN First Last DOB Phone Start End Note
16
Scheduling Aggregate Publishes Events
AppointmentCreatedEvent() { CreateAdmissionMessage() } HL7 2.x MSH|^~\&|ADT1|MCM|LABADT|MCM| |SECURITY|ADT^A01|MSG00001-|P|2.3 EVN|A01| PID|||PATID1234^5^M11||JONES^WILLIAM^A^III|| |M-||C|1200 N ELM STREET^^GREENSBORO^NC^ |GL|(91-9) |(919)271- 3434||S||PATID ^2^M10| | ^NC
17
Scheduling Aggregate Publishes Events
AppointmentCreatedEvent() { UpdateDataMart() }
18
Patient Dashboard Example Two Separate Models (CQRS)
Domain (Transaction) Model Complex structure (RIM) Aggregates are only created from RIM Aggregates are appended (Write Only) Query Model Simplified model structure (SQL) Multiple models created as needed Model optimized for querying (Read Only)
19
Simple Component Design CQRS
Web Dashboard View Model Aggregate Services App Services Publishes to Commands Query Events SQL
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.