示例#1
0
        public void TestUpdatePIDMultipleNames()
        {
            var actual = new ADT_A01().PID;

            this.patient.Names.Add(new EntityName(NameUseKeys.Search, "Norgate", "Andrew"));

            NotifierBase.UpdatePID(this.patient, actual, this.configuration);

            Assert.AreEqual("M", actual.Sex.Value);
            Assert.AreEqual("19700101000000.000-0500", actual.DateTimeOfBirth.TimeOfAnEvent.Value);

            var mothersName = actual.GetMotherSMaidenName(0);

            Assert.AreEqual("Smith", mothersName.FamilyLastName.FamilyName.Value);
            Assert.AreEqual("Mary L A", mothersName.GivenName.Value);

            var nameRepOne = actual.GetPatientName(0);

            Assert.AreEqual("Khanna", nameRepOne.FamilyLastName.FamilyName.Value);
            Assert.AreEqual("Nityan David", nameRepOne.GivenName.Value);

            var nameRepTwo = actual.GetPatientName(1);

            Assert.AreEqual("Norgate", nameRepTwo.FamilyLastName.FamilyName.Value);
            Assert.AreEqual("Andrew", nameRepTwo.GivenName.Value);
        }
示例#2
0
        public void TestUpdatePIDGenderConceptKeyUndifferentiated()
        {
            var actual = new ADT_A01().PID;

            this.patient.GenderConcept    = null;
            this.patient.GenderConceptKey = Guid.Parse("ae94a782-1485-4241-9bca-5b09db2156bf");

            this.patient.Names.Add(new EntityName(NameUseKeys.Search, "Norgate", "Andrew"));

            NotifierBase.UpdatePID(this.patient, actual, this.configuration);

            Assert.AreEqual("U", actual.Sex.Value);
            Assert.AreEqual("19700101000000.000-0500", actual.DateTimeOfBirth.TimeOfAnEvent.Value);

            var mothersName = actual.GetMotherSMaidenName(0);

            Assert.AreEqual("Smith", mothersName.FamilyLastName.FamilyName.Value);
            Assert.AreEqual("Mary L A", mothersName.GivenName.Value);

            var nameRepOne = actual.GetPatientName(0);

            Assert.AreEqual("Khanna", nameRepOne.FamilyLastName.FamilyName.Value);
            Assert.AreEqual("Nityan David", nameRepOne.GivenName.Value);

            var nameRepTwo = actual.GetPatientName(1);

            Assert.AreEqual("Norgate", nameRepTwo.FamilyLastName.FamilyName.Value);
            Assert.AreEqual("Andrew", nameRepTwo.GivenName.Value);
        }
示例#3
0
        public void TestUpdatePIDGenderConceptKeyMale()
        {
            var actual = new ADT_A01().PID;

            this.patient.GenderConcept    = null;
            this.patient.GenderConceptKey = Guid.Parse("f4e3a6bb-612e-46b2-9f77-ff844d971198");

            this.patient.Names.Add(new EntityName(NameUseKeys.Search, "Norgate", "Andrew"));

            NotifierBase.UpdatePID(this.patient, actual, this.configuration);

            Assert.AreEqual("M", actual.Sex.Value);
            Assert.AreEqual("19700101000000.000-0500", actual.DateTimeOfBirth.TimeOfAnEvent.Value);

            var mothersName = actual.GetMotherSMaidenName(0);

            Assert.AreEqual("Smith", mothersName.FamilyLastName.FamilyName.Value);
            Assert.AreEqual("Mary L A", mothersName.GivenName.Value);

            var nameRepOne = actual.GetPatientName(0);

            Assert.AreEqual("Khanna", nameRepOne.FamilyLastName.FamilyName.Value);
            Assert.AreEqual("Nityan David", nameRepOne.GivenName.Value);

            var nameRepTwo = actual.GetPatientName(1);

            Assert.AreEqual("Norgate", nameRepTwo.FamilyLastName.FamilyName.Value);
            Assert.AreEqual("Andrew", nameRepTwo.GivenName.Value);
        }
示例#4
0
        public void TestUpdateGenderUndifferentiatedConceptKey()
        {
            var actual = new ADT_A01().PID;

            NotifierBase.UpdateGender("ae94a782-1485-4241-9bca-5b09db2156bf", actual);

            Assert.AreEqual("U", actual.Sex.Value);
        }
示例#5
0
        public void TestUpdateGenderUndifferentiatedConcept()
        {
            var actual = new ADT_A01().PID;

            NotifierBase.UpdateGender("undifferentiated", actual);

            Assert.AreEqual("U", actual.Sex.Value);
        }
示例#6
0
        public void TestUpdateGenderMaleConceptKey()
        {
            var actual = new ADT_A01().PID;

            NotifierBase.UpdateGender("f4e3a6bb-612e-46b2-9f77-ff844d971198", actual);

            Assert.AreEqual("M", actual.Sex.Value);
        }
示例#7
0
        public void TestUpdateGenderMaleConcept()
        {
            var actual = new ADT_A01().PID;

            NotifierBase.UpdateGender("male", actual);

            Assert.AreEqual("M", actual.Sex.Value);
        }
示例#8
0
        public void TestUpdateGenderFemaleConceptKey()
        {
            var actual = new ADT_A01().PID;

            NotifierBase.UpdateGender("094941e9-a3db-48b5-862c-bc289bd7f86c", actual);

            Assert.AreEqual("F", actual.Sex.Value);
        }
示例#9
0
        public DialogConfigurationNotifier(NotifierBase notifier)
        {
            InitializeComponent();

            _notifier = notifier;

            //init base
            _soundChanged = false;
            _imageChanged = false;

            GroupSound.AllowDrop = true;
            GroupImage.AllowDrop = true;



            //init from data

            IsEnabled.Checked = notifier.IsEnabled;

            PlaysSound.Checked = notifier.PlaysSound;
            SoundPath.Text     = notifier.SoundPath;

            DrawsImage.Checked = notifier.DialogData.DrawsImage;
            ImagePath.Text     = notifier.DialogData.ImagePath;

            ShowsDialog.Checked        = notifier.ShowsDialog;
            TopMostFlag.Checked        = notifier.DialogData.TopMost;
            Alignment.SelectedIndex    = (int)notifier.DialogData.Alignment;
            LocationX.Value            = notifier.DialogData.Location.X;
            LocationY.Value            = notifier.DialogData.Location.Y;
            DrawsMessage.Checked       = notifier.DialogData.DrawsMessage;
            HasFormBorder.Checked      = notifier.DialogData.HasFormBorder;
            AccelInterval.Value        = notifier.AccelInterval / 1000;
            ClosingInterval.Value      = notifier.DialogData.ClosingInterval / 1000;
            CloseOnMouseOver.Checked   = notifier.DialogData.CloseOnMouseMove;
            ShowWithActivation.Checked = notifier.DialogData.ShowWithActivation;
            ForeColorPreview.ForeColor = notifier.DialogData.ForeColor;
            BackColorPreview.ForeColor = notifier.DialogData.BackColor;

            NotifierDamage ndmg = notifier as NotifierDamage;

            if (ndmg != null)
            {
                NotifiesBefore.Checked        = ndmg.NotifiesBefore;
                NotifiesNow.Checked           = ndmg.NotifiesNow;
                NotifiesAfter.Checked         = ndmg.NotifiesAfter;
                ContainsNotLockedShip.Checked = ndmg.ContainsNotLockedShip;
                ContainsSafeShip.Checked      = ndmg.ContainsSafeShip;
                ContainsFlagship.Checked      = ndmg.ContainsFlagship;
                LevelBorder.Value             = ndmg.LevelBorder;
                NotifiesAtEndpoint.Checked    = ndmg.NotifiesAtEndpoint;
            }
            else
            {
                GroupDamage.Visible = false;
                GroupDamage.Enabled = false;
            }
        }
示例#10
0
        public void TestUpdateXPN()
        {
            var actual = new XPN(this.genericMessage);

            NotifierBase.UpdateXPN(entityName, actual);

            Assert.AreEqual("Khanna", actual.FamilyLastName.FamilyName.Value);
            Assert.AreEqual("Nityan David", actual.GivenName.Value);
        }
示例#11
0
        public void TestUpdateMSH()
        {
            var actual = this.genericMessage.GetStructure("MSH") as MSH;

            NotifierBase.UpdateMSH(actual, null, this.configuration);

            Assert.AreEqual("AL", actual.AcceptAcknowledgmentType.Value);
            Assert.AreEqual("UnitTestDevice", actual.ReceivingApplication.NamespaceID.Value);
            Assert.AreEqual("TestNotificationDomain", actual.ReceivingFacility.NamespaceID.Value);
            Assert.AreEqual("OpenIZ", actual.SendingApplication.NamespaceID.Value);
            Assert.AreEqual("OpenIZ", actual.SendingFacility.NamespaceID.Value);
        }
示例#12
0
        public void TestUpdateAD()
        {
            var actual = new XAD(this.genericMessage);

            NotifierBase.UpdateAD(entityAddress, actual);

            Assert.AreEqual("Hamilton", actual.City.Value);
            Assert.AreEqual("Canada", actual.Country.Value);
            Assert.AreEqual("L8N3T2", actual.ZipOrPostalCode.Value);
            Assert.AreEqual("Ontario", actual.StateOrProvince.Value);
            Assert.AreEqual("123 Main street west", actual.StreetAddress.Value);
        }
示例#13
0
        public void TestUpdateXPNLastNameOnly()
        {
            var actual = new XPN(this.genericMessage);

            this.entityName.Component = new List <EntityNameComponent>
            {
                new EntityNameComponent(NameComponentKeys.Family, "Khanna")
            };

            NotifierBase.UpdateXPN(this.entityName, actual);

            Assert.AreEqual("Khanna", actual.FamilyLastName.FamilyName.Value);
        }
示例#14
0
        public void TestUpdateXPNFirstNameOnly()
        {
            var actual = new XPN(this.genericMessage);

            this.entityName.Component = new List <EntityNameComponent>
            {
                new EntityNameComponent(NameComponentKeys.Given, "Nityan")
            };

            NotifierBase.UpdateXPN(this.entityName, actual);

            Assert.AreEqual("Nityan", actual.GivenName.Value);
        }
示例#15
0
        private void SendMessage()
        {
            NotifierFactory notifierFactory = new NotifierFactory();
            NotifierBase    notifier        = notifierFactory.GetNotifier(NotificationServerOption.LegacyHTTP, GetNotificationProps());

            if (devicetokenRadioBtn.Checked)
            {
                notifier.SendPushNotificationForSpecificDevice();
            }
            else
            {
                notifier.SendPushNotificationForTopic();
            }
        }
示例#16
0
        private void ShowJsonData()
        {
            NotifierFactory notifierFactory = new NotifierFactory();
            NotifierBase    notifier        = notifierFactory.GetNotifier(NotificationServerOption.LegacyHTTP, GetNotificationProps());
            string          jsonData;

            if (devicetokenRadioBtn.Checked)
            {
                jsonData = notifier.CreateNotificationMessageForSpecificDevice();
            }
            else
            {
                jsonData = notifier.CreateNotificationMessageForTopic();
            }
            jsonDataTextBox.Text = BeautifyJsonData(jsonData);
        }
示例#17
0
        public void TestUpdateADCityOnly()
        {
            var actual = new XAD(this.genericMessage);

            this.entityAddress.Component = new List <EntityAddressComponent>
            {
                new EntityAddressComponent(AddressComponentKeys.City, "Hamilton")
            };

            NotifierBase.UpdateAD(entityAddress, actual);

            Assert.AreEqual("Hamilton", actual.City.Value);
            Assert.AreEqual(string.Empty, actual.Country.Value);
            Assert.AreEqual(string.Empty, actual.ZipOrPostalCode.Value);
            Assert.AreEqual(string.Empty, actual.StateOrProvince.Value);
            Assert.AreEqual(string.Empty, actual.StreetAddress.Value);
        }
示例#18
0
        public void TestUpdatePID()
        {
            var actual = new ADT_A01().PID;

            Configuration.TargetConfiguration configuration = new Configuration.TargetConfiguration("Test", "llp://localhost:2100", "PAT_IDENTITY_SRC", "UnitTestDevice");

            configuration.NotificationDomainConfigurations.Add(new Configuration.NotificationDomainConfiguration("TestNotificationDomain"));

            NotifierBase.UpdatePID(this.patient, actual, configuration);

            Assert.AreEqual("M", actual.Sex.Value);
            Assert.AreEqual("19700101000000.000-0500", actual.DateTimeOfBirth.TimeOfAnEvent.Value);

            var mothersName = actual.GetMotherSMaidenName(0);

            Assert.AreEqual("Smith", mothersName.FamilyLastName.FamilyName.Value);
            Assert.AreEqual("Mary L A", mothersName.GivenName.Value);

            var name = actual.GetPatientName(0);

            Assert.AreEqual("Khanna", name.FamilyLastName.FamilyName.Value);
            Assert.AreEqual("Nityan David", name.GivenName.Value);
        }
        public DialogConfigurationNotifier(NotifierBase notifier)
        {
            InitializeComponent();

            _notifier = notifier;

            //init base
            _soundChanged = false;
            _imageChanged = false;

            GroupSound.AllowDrop = true;
            GroupImage.AllowDrop = true;



            //init from data

            IsEnabled.Checked = notifier.IsEnabled;

            PlaysSound.Checked = notifier.PlaysSound;
            SoundPath.Text     = notifier.SoundPath;
            SoundVolume.Value  = notifier.SoundVolume;
            LoopsSound.Checked = notifier.LoopsSound;

            DrawsImage.Checked = notifier.DialogData.DrawsImage;
            ImagePath.Text     = notifier.DialogData.ImagePath;

            ShowsDialog.Checked     = notifier.ShowsDialog;
            TopMostFlag.Checked     = notifier.DialogData.TopMost;
            Alignment.SelectedIndex = (int)notifier.DialogData.Alignment;
            LocationX.Value         = notifier.DialogData.Location.X;
            LocationY.Value         = notifier.DialogData.Location.Y;
            DrawsMessage.Checked    = notifier.DialogData.DrawsMessage;
            HasFormBorder.Checked   = notifier.DialogData.HasFormBorder;
            AccelInterval.Value     = notifier.AccelInterval / 1000;
            ClosingInterval.Value   = notifier.DialogData.ClosingInterval / 1000;
            for (int i = 0; i < (int)NotifierDialogClickFlags.HighestBit; i++)
            {
                CloseList.SetItemChecked(i, ((int)notifier.DialogData.ClickFlag & (1 << i)) != 0);
            }
            CloseList.SetItemChecked((int)NotifierDialogClickFlags.HighestBit, notifier.DialogData.CloseOnMouseMove);
            ShowWithActivation.Checked = notifier.DialogData.ShowWithActivation;
            ForeColorPreview.ForeColor = notifier.DialogData.ForeColor;
            BackColorPreview.ForeColor = notifier.DialogData.BackColor;
            LevelBorder.Maximum        = ExpTable.ShipMaximumLevel;

            NotifierDamage ndmg = notifier as NotifierDamage;

            if (ndmg != null)
            {
                NotifiesBefore.Checked        = ndmg.NotifiesBefore;
                NotifiesNow.Checked           = ndmg.NotifiesNow;
                NotifiesAfter.Checked         = ndmg.NotifiesAfter;
                ContainsNotLockedShip.Checked = ndmg.ContainsNotLockedShip;
                ContainsSafeShip.Checked      = ndmg.ContainsSafeShip;
                ContainsFlagship.Checked      = ndmg.ContainsFlagship;
                LevelBorder.Value             = ndmg.LevelBorder;
                NotifiesAtEndpoint.Checked    = ndmg.NotifiesAtEndpoint;
            }
            else
            {
                GroupDamage.Visible = false;
                GroupDamage.Enabled = false;
            }

            NotifierAnchorageRepair nanc = notifier as NotifierAnchorageRepair;

            if (nanc != null)
            {
                AnchorageRepairNotificationLevel.SelectedIndex = nanc.NotificationLevel;
            }
            else
            {
                GroupAnchorageRepair.Visible = false;
                GroupAnchorageRepair.Enabled = false;
            }


            DialogOpenSound.Filter = "音楽ファイル|" + string.Join(";", Utility.MediaPlayer.SupportedExtensions.Select(s => "*." + s)) + "|File|*";
        }
 /// <summary>Creates service definition that can be registered with a server</summary>
 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
 public static grpc::ServerServiceDefinition BindService(NotifierBase serviceImpl)
 {
     return(grpc::ServerServiceDefinition.CreateBuilder()
            .AddMethod(__Method_Data, serviceImpl.Data).Build());
 }
示例#21
0
 /// <summary>Register service method with a service binder with or without implementation. Useful when customizing the  service binding logic.
 /// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
 /// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
 public static void BindService(grpc::ServiceBinderBase serviceBinder, NotifierBase serviceImpl)
 {
     serviceBinder.AddMethod(__Method_Notify, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::GrpcAgent.NotifyCommand, global::GrpcAgent.NotifyResponse>(serviceImpl.Notify));
 }