예제 #1
0
        public IQCareEmrService(IPatientService patientService, IEmrRepository emrRepository,
                                ICreateEmrPatientHandler createEmrPatientHandler, ICreateEmrEncounterHandler createEmrEncounterHandler)
        {
            _patientService            = patientService;
            _patientService.EmrService = this;
            _patientService.EncounterService.EmrService = this;
            _encounterService = patientService.EncounterService;

            EmrRepository = emrRepository;

            CreateEmrPatientHandler   = createEmrPatientHandler;
            CreateEmrEncounterHandler = createEmrEncounterHandler;

            _patientService.PatientCreatedEvent     += PatientService_PatientCreatedEvent;
            _encounterService.EncounterCreatedEvent += EncounterService_EncounterCreatedEvent;
        }
예제 #2
0
        public void Setup()
        {
            _testEncounters = _factory.GenerateTestEncountersByType(1);
            _patient        = _testEncounters.First().Patient;
            _uow            = new UnitOfWork(new SyncContext());
            _emrRepository  = new EmrRepository();

            _createEmrPatientHandler   = new CreateEmrPatientHandler();
            _createEmrEncounterHandler = new CreateEmrEncounterHandler();

            _patientService   = new PatientService(_uow, _emrRepository, _createEmrPatientHandler, _createEmrEncounterHandler);
            _encounterService = _patientService.EncounterService;

            _patientService.Sync(_patient, true);
            _iqPatient = new EmrRepository().GetPatient(_patient.UuId);
            uuids      = new List <Guid>();
        }
예제 #3
0
        public void Setup()
        {
            uuids           = new List <Guid>();
            testIQPatientId = -1;


            _testPatients         = _factory.GenerateTestPatients();
            _patientWithEncounter = _factory.GenerateTestEncountersByType(1).First().Patient;
            _uow                       = new UnitOfWork(new SyncContext());
            _emrRepository             = new EmrRepository();
            _createEmrPatientHandler   = new CreateEmrPatientHandler();
            _createEmrEncounterHandler = new CreateEmrEncounterHandler();

            _patientService   = new PatientService(_uow, _emrRepository, _createEmrPatientHandler, _createEmrEncounterHandler);
            _encounterService = _patientService.EncounterService;


            _emrService = _patientService.EmrService;
        }
예제 #4
0
        public void Setup()
        {
            _factory                   = new Factory();
            testIQPatientId            = -1;
            _testPatients              = _factory.GenerateTestPatients();
            _testEncounters            = _factory.GenerateTestEncountersByType(1);
            _uow                       = new UnitOfWork(new SyncContext());
            _emrRepository             = new EmrRepository();
            _createEmrPatientHandler   = new CreateEmrPatientHandler();
            _createEmrEncounterHandler = new CreateEmrEncounterHandler();

            _patientService   = new PatientService(_uow, _emrRepository, _createEmrPatientHandler, _createEmrEncounterHandler);
            _encounterService = _patientService.EncounterService;


            var _visitType = _emrRepository.GetVisitTypeByFeature(_testEncounters.First().EncounterType.IqcareId.Value);
            var location   = _emrRepository.GetLocation(1024);
            var concepts   = _uow.MConceptRepository.GetAllByEncounterType(_testEncounters.First().EncounterTypeId).ToList();
            var htslookups = _uow.LookupHtsRepository.GetAll().ToList();

            _encounterCreated = new EncounterCreated(_testEncounters.First().Patient, _visitType, _testEncounters.First(), location, concepts, htslookups);
        }
예제 #5
0
 public PatientService(IUnitOfWork uow, IEmrRepository emrRepository, ICreateEmrPatientHandler createEmrPatientHandler, ICreateEmrEncounterHandler createEmrEncounterHandler)
 {
     _uow                        = uow;
     EncounterService            = new EncounterService(uow, this);
     EmrService                  = new IQCareEmrService(this, emrRepository, createEmrPatientHandler, createEmrEncounterHandler);
     EncounterService.EmrService = EmrService;
 }