예제 #1
0
파일: Hl7Server.cs 프로젝트: ewcasas/DVTK
        /// <summary>
        /// Class constructor.
        /// </summary>
        /// <param name="parentActor">Parent Actor Name - (containing actor).</param>
        /// <param name="actorName">Destination Actor Name.</param>
        /// <param name="commonConfig">Common Configuration.</param>
        /// <param name="config">HL7 Configuration.</param>
        public Hl7Server(BaseActor parentActor, ActorName actorName, CommonConfig commonConfig, Hl7PeerToPeerConfig config)
            : base(parentActor, actorName)
        {
            _hl7ThreadForHl7Server = new Hl7ThreadForHl7Server(this);
            DvtkHighLevelInterface.Common.Threads.ThreadManager threadManager = new DvtkHighLevelInterface.Common.Threads.ThreadManager();
            _hl7ThreadForHl7Server.Initialize(threadManager);
            _hl7ThreadForHl7Server.Options.UseResultsFileNameIndex = true;
            _hl7ThreadForHl7Server.Options.SessionId = config.SessionId;
            _hl7ThreadForHl7Server.Options.Identifier = String.Format("To_{0}_From_{1}",
                ParentActor.ActorName.TypeId,
                ActorName.TypeId);

            _config = config;

            if (commonConfig.ResultsDirectory != System.String.Empty)
            {
                if (commonConfig.ResultsSubdirectory != System.String.Empty)
                {
                    _hl7ThreadForHl7Server.Options.ResultsDirectory = RootedBaseDirectory.GetFullPathname(commonConfig.RootedBaseDirectory, commonConfig.ResultsDirectory + "\\" + commonConfig.ResultsSubdirectory);
                }
                else
                {
                    _hl7ThreadForHl7Server.Options.ResultsDirectory = RootedBaseDirectory.GetFullPathname(commonConfig.RootedBaseDirectory, commonConfig.ResultsDirectory);
                }
            }

            // Set up the HL7 Validation Profile Store
            if ((commonConfig.Hl7ProfileDirectory != System.String.Empty) &&
                (commonConfig.Hl7ProfileStoreName != System.String.Empty))
            {
                _hl7ProfileStore = new Hl7ProfileStore(RootedBaseDirectory.GetFullPathname(commonConfig.RootedBaseDirectory, commonConfig.Hl7ProfileDirectory), commonConfig.Hl7ProfileStoreName);
            }

            // Set up the HL7 Validation Context
            if (commonConfig.Hl7ValidationContextFilename != System.String.Empty)
            {
                _hl7ValidationContext = new Hl7ValidationContext(RootedBaseDirectory.GetFullPathname(commonConfig.RootedBaseDirectory, commonConfig.Hl7ValidationContextFilename));
            }

            // Set up the validation Web Service
            if (commonConfig.NistWebServiceUrl != System.String.Empty)
            {
                _nistWebServiceClient = new NistWebServiceClient(commonConfig.NistWebServiceUrl);
            }
        }
예제 #2
0
        /// <summary>
        /// Class constructor.
        /// </summary>
        /// <param name="parentActor">Parent Actor Name - (containing actor).</param>
        /// <param name="actorName">Destination Actor Name.</param>
        /// <param name="commonConfig">Common Configuration.</param>
        /// <param name="config">HL7 Configuration.</param>
        public Hl7Server(BaseActor parentActor, ActorName actorName, CommonConfig commonConfig, Hl7PeerToPeerConfig config) : base(parentActor, actorName)
        {
            _hl7ThreadForHl7Server = new Hl7ThreadForHl7Server(this);
            DvtkHighLevelInterface.Common.Threads.ThreadManager threadManager = new DvtkHighLevelInterface.Common.Threads.ThreadManager();
            _hl7ThreadForHl7Server.Initialize(threadManager);
            _hl7ThreadForHl7Server.Options.UseResultsFileNameIndex = true;
            _hl7ThreadForHl7Server.Options.SessionId  = config.SessionId;
            _hl7ThreadForHl7Server.Options.Identifier = String.Format("To_{0}_From_{1}",
                                                                      ParentActor.ActorName.TypeId,
                                                                      ActorName.TypeId);

            _config = config;

            if (commonConfig.ResultsDirectory != System.String.Empty)
            {
                if (commonConfig.ResultsSubdirectory != System.String.Empty)
                {
                    _hl7ThreadForHl7Server.Options.ResultsDirectory = RootedBaseDirectory.GetFullPathname(commonConfig.RootedBaseDirectory, commonConfig.ResultsDirectory + "\\" + commonConfig.ResultsSubdirectory);
                }
                else
                {
                    _hl7ThreadForHl7Server.Options.ResultsDirectory = RootedBaseDirectory.GetFullPathname(commonConfig.RootedBaseDirectory, commonConfig.ResultsDirectory);
                }
            }

            // Set up the HL7 Validation Profile Store
            if ((commonConfig.Hl7ProfileDirectory != System.String.Empty) &&
                (commonConfig.Hl7ProfileStoreName != System.String.Empty))
            {
                _hl7ProfileStore = new Hl7ProfileStore(RootedBaseDirectory.GetFullPathname(commonConfig.RootedBaseDirectory, commonConfig.Hl7ProfileDirectory), commonConfig.Hl7ProfileStoreName);
            }

            // Set up the HL7 Validation Context
            if (commonConfig.Hl7ValidationContextFilename != System.String.Empty)
            {
                _hl7ValidationContext = new Hl7ValidationContext(RootedBaseDirectory.GetFullPathname(commonConfig.RootedBaseDirectory, commonConfig.Hl7ValidationContextFilename));
            }

            // Set up the validation Web Service
            if (commonConfig.NistWebServiceUrl != System.String.Empty)
            {
                _nistWebServiceClient = new NistWebServiceClient(commonConfig.NistWebServiceUrl);
            }
        }