anchor.diff:      | Triaged of PatientTriagedEvent
       | Registered of PatientRegisteredEvent
       | PickedUp of PatientPickedUpEvent
  -    | Discharged of PatientDischaredEvent
  +    | Discharged of PatientDischargedEvent
   
       let systemConfiguration = { 
           SetSourceMessageId = (fun id metadata -> { metadata with SourceMessageId = id })
           SetMessageId = (fun id metadata -> { metadata with MessageId = id })
       }
   
  -    let inline simpleHandler s f = 
  +    let stateBuilder = NamedStateBuilder.nullStateBuilder<EmergencyEventMetadata>
  +
  +    let inline simpleHandler f = 
           let withMetadata = f >> (fun x -> (x, { SourceMessageId = String.Empty; MessageId = Guid.Empty }))
  -        Eventful.AggregateActionBuilder.simpleHandler systemConfiguration s withMetadata
  +        Eventful.AggregateActionBuilder.simpleHandler systemConfiguration stateBuilder withMetadata
  +    
  +    let inline buildCmdHandler f =
  +        f
  +        |> simpleHandler
  +        |> buildCmd
   
       let inline fullHandler s f =
           let withMetadata a b c =
  
positive.code:                     PickupTime = cmd.PickupTime
                  }
  
             yield pickupPatient
                  |> simpleHandler stateBuilder
                  |> buildCmd
  
             let dischargePatient (cmd : DischargePatientCommand) =
                  Discharged {    
                      VisitId = cmd.VisitId
                      DischargeLocation = cmd.DischargeLocation
                  }
  
             yield dischargePatient
                  |> simpleHandler stateBuilder
                  |> buildCmd
          }
  
      let handlers =
  
negative.code:                    TriageLevel = cmd.TriageLevel
                 }
  
             yield buildCmdHandler triagePatient
  
             yield registerPatient
                  |> fullHandler isRegistered
  