Presentation is loading. Please wait.

Presentation is loading. Please wait.

Domain Driven Design and Event Sourcing with RIM.

Similar presentations

Presentation on theme: "Domain Driven Design and Event Sourcing with RIM."— Presentation transcript:

1 Domain Driven Design and Event Sourcing with RIM

2 Introduction 1 RIMResistance is Futile, you Will be Assimilated!

3 DDD and Event Sourcing 2 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 3 Agenda – Google will find heaps of stuff on this – Will focus on the RIM stuff – Great resources for DDD/ES us/library/jj aspx us/library/jj aspx Implementing Doman-Driven Design – Vaughn Vernon Domain Driven Design (the Blue Book) – Eric Evans

5 DDD and Event Sourcing 4 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 Model Blueprint for all Aggregates 5 HL7 V3 RIM

7 6 Vocabulary Supporting Domains External Services Bounded Contexts

8 7 Supporting Domains External Services Other systems or Big Ball of Mud… Anti Corruption Layer Business Process and Rules Engines Point: This layer keeps RIM pure!

9 DDD and Event Sourcing 8 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 Example Use Case 9 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 10 Scheduling Aggregate Example

12 11 Scheduling Aggregate CMET (PAT) is the Root

13 12 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 13 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 14 Scheduling Aggregate Appended IDNameVersionData 1Schedule1.2 2Schedule1.2 3Schedule1.2 CreateAppointmentCommand(data) Event Store

16 15 Scheduling Aggregate Publishes Events AppointmentCreatedEvent(data) { MRNFirstLastDOBPhoneStartEndNote UpdateDatabaseView() } Query model

17 16 Scheduling Aggregate Publishes Events AppointmentCreatedEvent() { CreateAdmissionMessage() } HL7 2.x MSH|^~\&|ADT1|MCM|LABADT|MCM| |SECURITY|ADT^A01|MSG |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) ||S||PATID ^2^M10| | ^NC

18 Scheduling Aggregate Publishes Events AppointmentCreatedEvent() { UpdateDataMart() }

19 Patient Dashboard Example Two Separate Models (CQRS) 18 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 Design CQRS 19 Web Dashboard Web Dashboard View Model Aggregate Services App Services Publishes to Commands Query Events SQL

Download ppt "Domain Driven Design and Event Sourcing with RIM."

Similar presentations

Ads by Google