Domain Driven Design and Event Sourcing with RIM - PowerPoint PPT Presentation

About This Presentation
Title:

Domain Driven Design and Event Sourcing with RIM

Description:

Domain Driven Design and Event Sourcing with RIM * * * * * * * * * * Introduction * RIMResistance is Futile, you Will be Assimilated! DDD and Event Sourcing ... – PowerPoint PPT presentation

Number of Views:188
Avg rating:3.0/5.0
Slides: 21
Provided by: Tom403
Learn more at: http://www.hl7.org
Category:

less

Transcript and Presenter's Notes

Title: Domain Driven Design and Event Sourcing with RIM


1
Domain Driven Design and Event Sourcing with RIM
2
Introduction
RIMResistance is Futile, you Will be Assimilated!
3
DDD and Event Sourcing
  • Introduction
  • 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

4
DDD and Event Sourcing
  • Agenda
  • Google will find heaps of stuff on this
  • Will focus on the RIM stuff
  • Great resources for DDD/ES
  • http//msdn.microsoft.com/en-us/library/jj554200.a
    spx
  • Implementing Doman-Driven Design
  • Vaughn Vernon
  • Domain Driven Design (the Blue Book)
  • Eric Evans

5
DDD and Event Sourcing
  • Domain Driven Design
  • 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

6
Domain ModelBlueprint for all Aggregates
HL7 V3 RIM
7
Supporting DomainsExternal Services
Vocabulary
Bounded Contexts
8
Supporting DomainsExternal Services
Anti Corruption Layer
Other systems or Big Ball of Mud
Business Process and Rules Engines
Point This layer keeps RIM pure!
9
DDD and Event Sourcing
  • 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

10
Patient Dashboard ExampleUse 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

11
Scheduling AggregateExample
12
Scheduling AggregateCMET (PAT) is the Root
13
Scheduling Aggregate
  • Considerations
  • 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

14
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

15
Scheduling AggregateAppended
CreateAppointmentCommand(data)
Event Store
ID Name Version Data
1 Schedule 1.2
2 Schedule 1.2
3 Schedule 1.2
16
Scheduling AggregatePublishes Events
AppointmentCreatedEvent(data)
UpdateDatabaseView()

Query model
MRN First Last DOB Phone Start End Note


17
Scheduling AggregatePublishes Events
AppointmentCreatedEvent()
CreateAdmissionMessage()

HL7 2.x
MSH\ADT1MCMLABADTMCM198808181126SECURITY
ADTA01MSG00001-P2.3 EVNA01198808181123 PID
PATID12345M11JONESWILLIAMAIII19610615M
-C1200 N ELM STREETGREENSBORONC27401-1020G
L(91-9)379-1212(919)271- 3434SPATID12345001
2M101234567899-87654NC
18
Scheduling AggregatePublishes Events
AppointmentCreatedEvent()
UpdateDataMart()

19
Patient Dashboard ExampleTwo 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)

20
Simple Component DesignCQRS
Write a Comment
User Comments (0)
About PowerShow.com