示例#1
0
        public void Handle(PatientCreated args)
        {
            //TODO: Remove hard codede ModuleID,VisitType,LocationID values

            _sqlActions = new List <SqlAction>();
            _patient    = args.Patient;
            _location   = args.Location;
            _module     = args.Module;
            _visittype  = args.VisitType;

            _notification = $"Creating Patient[{args.Patient}] Encounters[{args.Patient.Encounters?.Count ?? 0}]";
            Log.Debug(_notification);
            GenerateSqlActions();
        }
        public async Task Handle(PatientCreated message)
        {
            var obj   = this.ParseMessage(message);
            var usual = obj.Name.First(n => n.Use == HumanName.NameUse.Usual);

            var notification = new Notification
            {
                Ods         = message.Destination,
                System      = message.System,
                NhsNumber   = obj.Identifier[0]?.Value,
                DateCreated = DateTime.UtcNow,
                Type        = obj.TypeName,
                Summary     = $"Patient Created: {obj.Identifier[0]?.Value}",
                Details     = $"{usual?.Family}, {string.Join(" ", usual?.Given)} ({string.Join(" ", usual?.Prefix)})",
                Json        = this.ToString()
            };

            await this.Notifications.AddOrUpdate(notification);

            await this.Hub.Clients.Group(message.Destination?.ToLowerInvariant()).SendAsync("notification", notification);
        }
示例#3
0
 public async Task Handle(PatientCreated message)
 {
 }
示例#4
0
 public void CreatePatient(PatientCreated args)
 {
     CreateEmrPatientHandler.Handle(args);
     EmrRepository.CreatePatient(CreateEmrPatientHandler.GetSqlActions(), args.Patient.UuId);
 }
示例#5
0
 protected virtual void PatientService_PatientCreatedEvent(object sender, PatientCreated e)
 {
     CreatePatient(e);
 }
示例#6
0
 protected virtual void OnPatientCreatedEvent(PatientCreated e)
 {
     PatientCreatedEvent?.Invoke(this, e);
 }