Beispiel #1
0
 public IdentityUnitOfWork(string connectionString)
 {
     db                = new ApplicationContext(connectionString);
     userManager       = new ApplicationUserManager(new UserStore <ApplicationUser>(db));
     roleManager       = new ApplicationRoleManager(new RoleStore <ApplicationRole>(db));
     studentRepository = new StudentRepository(db);
     studyRepository   = new StudyRepository(db);
 }
Beispiel #2
0
 public PatientController(IPatientRepository patientRepository, IRoomRepository roomRepository, IUnitOfWork unitOfWork, IMapper mapper, IDoctorPatientRepository doctorPatientRepository, IStudyRepository studyRepository)
 {
     _patientRepository       = patientRepository;
     _roomRepository          = roomRepository;
     _unitOfWork              = unitOfWork;
     _mapper                  = mapper;
     _doctorPatientRepository = doctorPatientRepository;
     _studyRepository         = studyRepository;
 }
Beispiel #3
0
 /// <inheritdoc />
 public ConsentControllerTestBase()
 {
     Study         = Create.Study;
     StudyId       = new StudyIdentity(Study.Id);
     StudySubject  = new StudySubject(StudyId, "AA100023", new PersonIdentity(500L));
     Studies       = CreateStudyRepository(Study);
     StudySubjects = CreateSubjectRepository(Study, StudySubject);
     Consents      = CreateConsentRepository(Study, StudySubject);
 }
 public ConsentController(
     IStudyRepository studies,
     IStudySubjectRepository subjects,
     IConsentRepository consents,
     EvidenceDefinitionRegistry registry,
     ILogger <ConsentController> logger = null)
 {
     Studies  = studies;
     Subjects = subjects;
     Logger   = logger ?? NullLogger <ConsentController> .Instance;
     Consents = consents;
     EvidenceDtoMarshallers = new EvidenceDtosIdentifierDtoMarshaller(registry);
 }
Beispiel #5
0
        public StudyEventHandler(IStudyRepository studyRepository, IEventPublisher eventPublisher)
        {
            _handlers = new Dictionary <Type, Action <Event> >();
            _handlers.Add(typeof(StudyCreatedEvent), (e) => Handle((StudyCreatedEvent)e));
            _handlers.Add(typeof(AccessionNumberChangedEvent), (e) => Handle((AccessionNumberChangedEvent)e));
            _handlers.Add(typeof(StudyReviewedEvent), (e) => Handle((StudyReviewedEvent)e));

            // TODO: Separate validation rules into its own object so that they can be managed separately
            _validationRules = new List <IValidationRule>()
            {
                new PrefixAccessionNumberValidationRule()
                {
                    Prefix = "30-",
                    Option = PrefixAccessionNumberValidationRule.PrefixOption.DoesNotStartWith
                }
            };

            _studyRepository = studyRepository;
            _eventPublisher  = eventPublisher;
        }
Beispiel #6
0
        /// <inheritdoc />
        public StudiesModel(
            IStudyRepository studies,
            IStudySubjectRepository subjects,
            IConsentRepository consent,
            IIdentityRepository identityRepository,
            IdentifierDefinitionRegistry identifierDefinitionRegistry,
            IUserProvider user,
            IOptions <IdentifierDisplayOptions> displayOptionsProvider,
            ILogger <StudiesModel> logger
            )
        {
            Studies                           = studies;
            Subjects                          = subjects;
            Logger                            = logger;
            this.user                         = user;
            this.consent                      = consent;
            this.identityRepository           = identityRepository;
            this.identifierDefinitionRegistry = identifierDefinitionRegistry;
            displayOptions                    = displayOptionsProvider.Value;

            SearchGroups = GetDefinedSearchGroups();
        }
Beispiel #7
0
 public StudyService(IStudyRepository studyRepository)
 {
     _studyRepository = studyRepository;
 }
Beispiel #8
0
 public StudiesController(IStudyRepository repository)
 {
     _repository = repository;
 }
Beispiel #9
0
 public StudyController(IStudyRepository repository, ILogger <StudyController> log)
 {
     _repository = repository;
     _log        = log;
 }
Beispiel #10
0
 public Importer(IStudyRepository studyRepo, IDicomFileRepository fileRepo)
 {
     _studyRepo = studyRepo;
     _fileRepo  = fileRepo;
 }
Beispiel #11
0
 public StudysController(IStudyRepository studyRepository, IGradeRepository gradeRepository)
 {
     _studyRepository = studyRepository;
     _gradeRepository = gradeRepository;
 }
Beispiel #12
0
 public StudyCreatedEventHandler(IStudyRepository repo)
 {
     _repo = repo;
 }
Beispiel #13
0
 /// <inheritdoc />
 public IndexModel(IStudyRepository consent, IUserProvider user)
 {
     Consent   = consent;
     this.user = user;
 }
Beispiel #14
0
        /// <inheritdoc />
        public ConsentRepositoryTests(ITestOutputHelper outputHelper, DatabaseFixture fixture) : base(outputHelper, fixture)
        {
            readContext   = CreateNewContextInSameTransaction();
            updateContext = CreateNewContextInSameTransaction();
            createContext = CreateNewContextInSameTransaction();


            study = createContext.Studies.Add(new StudyEntity {
                Name = Random.String()
            }).Entity;

            var consentedPerson = createContext.People.Add(new PersonEntity()).Entity;

            consentedStudySubject = createContext.Add(new StudySubjectEntity {
                Study = study, Person = consentedPerson, SubjectIdentifier = "Consented"
            }).Entity;
            createContext.Add(
                new ConsentEntity
            {
                StudySubject  = consentedStudySubject,
                DateProvided  = 1.December(1965),
                DateWithdrawn = 1.January(1966),
                GivenBy       = consentedPerson
            });

            activeConsent = createContext.Add(
                new ConsentEntity
            {
                StudySubject = consentedStudySubject,
                DateProvided = 1.February(1966),
                GivenBy      = consentedPerson
            }).Entity;

            var unconsentedPerson = createContext.People.Add(new PersonEntity()).Entity;

            createContext.Add(
                new StudySubjectEntity {
                Study = study, Person = unconsentedPerson, SubjectIdentifier = "Unconsented"
            });

            var withdrawnConsent = createContext.Add(new PersonEntity()).Entity;
            var withdrawnSubject = createContext.Add(
                new StudySubjectEntity {
                Study = study, Person = withdrawnConsent, SubjectIdentifier = "Withdrawn"
            }).Entity;

            withdrawnSubjectWithdrawnDate = 5.January(2018);
            createContext.Add(new ConsentEntity
            {
                StudySubject  = withdrawnSubject,
                DateProvided  = 1.December(2017),
                DateWithdrawn = withdrawnSubjectWithdrawnDate,
                GivenBy       = withdrawnConsent
            });


            createContext.SaveChanges();

            studyId             = new StudyIdentity(study.Id);
            consentedPersonId   = consentedPerson;
            unconsentedPersonId = unconsentedPerson;
            withdrawnPersonId   = withdrawnConsent;

            consents = CreateConsentRepository(readContext);

            studySubjects = CreateStudySubjectRepository(readContext);
            studies       = CreateStudyRepository(readContext);
        }