Dental Clinic

Dental Clinic - Domain Events & Integration Contracts

Domain events emitted by the Dental Clinic context, integration contracts, and asynchronous downstream reactions across enterprise systems.

Domain Events & Integration Contracts

The Dental Clinic bounded context communicates with the broader Obelaw enterprise ecosystem exclusively via state-altering, immutable domain events and formal integration contracts. This decoupled, event-driven pattern allows downstream domains (Accounting, Inventory, CRM, Medical Imaging) to react to clinical facts without impeding chairside operatory workflows or introducing synchronous network dependencies.


1. Domain Events Emitted

The following table catalogs the core domain events emitted by the Dental Clinic bounded context:

Event NameSource AggregateEmitted WhenConceptual Payload Highlights
DentalPatientEncounterStartedOperatoryEncounterPatient is seated in the operatory chair and session initiates.EncounterId, PatientId, OperatoryId, AttendingDentistId, AssistantId, StartTime.
MedicalAlertVerifiedOperatoryEncounterAttending dentist completes and signs off on systemic health checks.EncounterId, PatientId, DentistId, AllergiesConfirmed, AntibioticProphylaxisTaken, InrValue.
OdontogramConditionChartedPatientDentalRecordA new tooth diagnosis, existing restoration, or pathology is recorded.PatientId, ToothNumber, Surfaces, PathologyCode, DentistId, ChartTimestamp.
PeriodontalExamCompletedPatientDentalRecordFull-mouth periodontal probing measurements are finalized.PatientId, ExamDate, ExaminerId, BleedingOnProbingPercent, SitesWithPocketsGe4mm, BopSitesCount.
DentalTreatmentPlanCreatedTreatmentPlanDentist formulates and sequences a multi-phase treatment plan.TreatmentPlanId, PatientId, DiagnosingDentistId, PhaseCount, TotalEstimatedCost.
DentalTreatmentPlanAcceptedTreatmentPlanPatient formally agrees to the treatment plan and payment structure.TreatmentPlanId, PatientId, AcceptedPhases, PatientSignedTimestamp, CoordinatorId.
PatientInformedConsentSignedTreatmentPlanPatient or guardian signs legal consent for an invasive procedure.ConsentToken, PatientId, PlannedProcedureItemId, ToothNumber, RisksAcknowledged, SignatureHash.
DentalAnesthesiaAdministeredOperatoryEncounterLocal anesthesia is delivered chairside to the patient.EncounterId, AnestheticAgent, VasoconstrictorRatio, CarpuleVolumeTotal, InjectionTechnique.
DentalMaterialLotConsumedOperatoryEncounterAn implant, bone graft, membrane, or specialized resin is deployed.EncounterId, MaterialCategory, Manufacturer, LotNumber, SerialNumber, QuantityConsumed.
SterileCassetteConsumedOperatoryEncounterA wrapped sterile cassette pack barcode is scanned and verified at chairside.EncounterId, OperatoryId, CassetteBarcode, SterilizationBatchId, ScanTimestamp.
DentalProcedureCompletedOperatoryEncounterA clinical procedure is successfully finished chairside.EncounterId, PatientId, DentistId, CdtCode, ToothNumber, Surfaces, CompletionTimestamp.
DentalEncounterSignedAndSealedOperatoryEncounterAttending dentist signs clinical notes; encounter permanently locked.EncounterId, PatientId, DentistSignatureToken, ProceduresSummary, SealedTimestamp.
DentalClinicalAddendumAppendedOperatoryEncounterAn amending note or correction is attached to a sealed encounter.AddendumId, EncounterId, DentistId, ReasonCode, AmendedTextHash, Timestamp.
DentalLabOrderDispatchedDentalLabOrderIndirect prosthetic prescription and digital scans sent to lab.LabOrderId, ExternalLabId, ToothNumber, RestorationType, Shade, ScanMeshHash, DueDate.
DentalLabRestorationReceivedDentalLabOrderCommercial lab delivers fabricated prosthesis to the clinic.LabOrderId, DeliveryTrackingCode, ReceivedTimestamp, InternalInspectorId.
DentalLabRestorationSeatedDentalLabOrderDentist permanently bonds or cements the laboratory prosthesis.LabOrderId, EncounterId, CementType, OcclusionChecked, FinalSeatingTimestamp.
SterilizationCycleBatchCompletedSterilizationCycleBatchAutoclave finishes cycle meeting physical temperature and pressure bars.BatchId, AutoclaveId, CycleNumber, PeakTemperature, PeakPressure, HoldDurationMinutes.
BiologicalIndicatorResultRecordedSterilizationCycleBatchBacterial spore test incubation completes with verified result.BatchId, IncubatorId, SporeTestResult (Pass or Fail), VerifiedTimestamp.
SterilizationBatchQuarantinedSterilizationCycleBatchPhysical parameters or spore tests fail; cassette barcodes revoked.BatchId, AutoclaveId, FailureReason, QuarantinedCassetteBarcodes.
DentalRecallScheduledOperatoryEncounterClinical recare interval generated based on patient risk profile.PatientId, RecallType (PeriodontalMaintenance or RoutineProphylaxis), TargetRecallDate.

2. Integration Contracts & Downstream System Reactions

Downstream enterprise systems subscribe to Dental Clinic domain events through asynchronous message brokers:

flowchart TD
    DENTAL["Dental Clinic Domain"]

    E1["DentalProcedureCompleted"]
    E2["DentalMaterialLotConsumed"]
    E3["DentalEncounterSignedAndSealed"]
    E4["DentalRecallScheduled"]
    E5["SterilizationBatchQuarantined"]

    DENTAL --> E1
    DENTAL --> E2
    DENTAL --> E3
    DENTAL --> E4
    DENTAL --> E5

    E1 -->|Generate Insurance Claim & Bill Copay| FMS["Accounting & FMS"]
    E2 -->|Decrement Operatory Point-of-Use Stock| SCM["Inventory & SCM"]
    E3 -->|Record Patient Clinical History Milestone| CRM["CRM / Patient Master"]
    E4 -->|Schedule Automated Recall Reminders| RECARE["Recall / Outreach Engine"]
    E5 -->|Lock Cassette Inventories & Alert Staff| INFECTION["Infection Control Safety Dashboard"]

1. Accounting / FMS Integration Contract

  • Subscribed Event: DentalProcedureCompleted
  • Reaction:
    1. Creates an Accounts Receivable line item referencing the standardized CdtCode, attending provider license, and target tooth/surface geometry.
    2. Submits an electronic dental insurance claim (EDI 837D transaction) to the designated insurance clearinghouse, appending mandatory tooth indicators.
    3. Prepares the patient copayment invoice for collection at reception checkout.
  • Responsibility Boundary: The Dental Clinic context publishes the clinical procedure facts; Accounting owns revenue recognition, ledger posting, insurance payment remittances (EDI 835), and write-offs.

2. Inventory / SCM Integration Contract

  • Subscribed Events: DentalMaterialLotConsumed, DentalAnesthesiaAdministered
  • Reaction:
    1. Decrements point-of-use inventory from the specific operatory room stock bucket (e.g., deducting one titanium implant fixture from Operatory 2 surgical cart).
    2. Updates lot tracking registers, maintaining complete backward-traceability from implant lot number to patient record for regulatory implant registry reporting.
    3. Evaluates reorder thresholds; if stock for a specific composite shade or anesthetic carpule falls below par levels, triggers an automated purchase requisition.
  • Responsibility Boundary: Dental Clinic records clinical consumption; Inventory manages supplier orders, unit costs, and warehouse bin locations.

3. CRM & Recare Integration Contract

  • Subscribed Events: DentalEncounterSignedAndSealed, DentalRecallScheduled
  • Reaction:
    1. Updates the patient profile with their most recent clinical visit date and primary attending clinician.
    2. Schedules automated patient reminders (SMS/email) timed to their clinical risk interval:
      • High-risk periodontal patients receive reminders at 3-month intervals for periodontal maintenance.
      • Low-risk restorative patients receive reminders at 6-month intervals for routine dental prophylaxis and bitewing radiographs.
  • Responsibility Boundary: Dental Clinic establishes clinical recare intervals; CRM orchestrates communication channels, delivery timings, and patient engagement tracking.

4. Infection Control Safety Dashboard Reaction

  • Subscribed Event: SterilizationBatchQuarantined
  • Reaction:
    1. Broadcasts an urgent high-priority alert across all clinical workstation displays in the facility.
    2. Automatically blacklists every CassetteBarcode tied to the failed autoclave batch, preventing them from being verified at chairside.
    3. Queries historical encounters: if any cassette from the quarantined batch was erroneously scanned prior to spore incubation completion, an immediate regulatory patient notification audit protocol is triggered.

Our Premium Sponsors

Obelaw is proudly open-source. Continued development, bug fixes, and community support are made possible by the generosity of our sponsors.

Sponsor Obelaw