Пример #1
0
        /// <summary>
        ///  Prepare HATEOAS links for a single resource
        /// </summary>
        /// <param name="dto">The dto that the link has been added to</param>
        /// <returns></returns>
        private DatasetElementIdentifierDto CreateLinksForDatasetElement <T>(T dto)
        {
            DatasetElementIdentifierDto identifier = (DatasetElementIdentifierDto)(object)dto;

            identifier.Links.Add(new LinkDto(_linkGeneratorService.CreateResourceUri("DatasetElement", identifier.Id), "self", "GET"));

            return(identifier);
        }
Пример #2
0
        /// <summary>
        ///  Prepare HATEOAS links for a single resource
        /// </summary>
        /// <param name="dto">The dto that the link has been added to</param>
        /// <returns></returns>
        private HolidayIdentifierDto CreateLinksForHoliday <T>(T dto)
        {
            HolidayIdentifierDto identifier = (HolidayIdentifierDto)(object)dto;

            identifier.Links.Add(new LinkDto(_linkGeneratorService.CreateResourceUri("Holiday", identifier.Id), "self", "GET"));

            return(identifier);
        }
Пример #3
0
        /// <summary>
        ///  Prepare HATEOAS links for a single resource
        /// </summary>
        /// <param name="dto">The dto that the link has been added to</param>
        /// <returns></returns>
        private OutcomeIdentifierDto CreateLinksForOutcome <T>(T dto)
        {
            OutcomeIdentifierDto identifier = (OutcomeIdentifierDto)(object)dto;

            identifier.Links.Add(new LinkDto(_linkGeneratorService.CreateResourceUri("Outcome", identifier.Id), "self", "GET"));

            return(identifier);
        }
Пример #4
0
        /// <summary>
        ///  Prepare HATEOAS links for a single resource
        /// </summary>
        /// <param name="dto">The dto that the link has been added to</param>
        /// <returns></returns>
        private CustomAttributeIdentifierDto CreateLinksForCustomAttribute <T>(T dto)
        {
            CustomAttributeIdentifierDto identifier = (CustomAttributeIdentifierDto)(object)dto;

            identifier.Links.Add(new LinkDto(_linkGeneratorService.CreateResourceUri("CustomAttribute", identifier.Id), "self", "GET"));

            return(identifier);
        }
Пример #5
0
        /// <summary>
        ///  Prepare HATEOAS links for a single resource
        /// </summary>
        /// <param name="dto">The dto that the link has been added to</param>
        /// <returns></returns>
        private RiskFactorIdentifierDto CreateLinksForRiskFactor <T>(T dto)
        {
            RiskFactorIdentifierDto identifier = (RiskFactorIdentifierDto)(object)dto;

            identifier.Links.Add(new LinkDto(_linkGeneratorService.CreateResourceUri("RiskFactor", identifier.Id), "self", "GET"));

            return(identifier);
        }
Пример #6
0
        private async Task CreateLinksAsync(ReportInstance reportInstanceFromRepo, ReportInstanceDetailDto mappedReportInstance)
        {
            if (reportInstanceFromRepo == null)
            {
                throw new ArgumentNullException(nameof(reportInstanceFromRepo));
            }

            mappedReportInstance.Links.Add(new LinkDto(_linkGeneratorService.CreateReportInstanceResourceUri(reportInstanceFromRepo.WorkFlow.WorkFlowGuid, mappedReportInstance.Id), "self", "GET"));

            switch (reportInstanceFromRepo.CurrentActivity.QualifiedName)
            {
            case "Confirm Report Data":
                CreateLinksForConfirmationStep(reportInstanceFromRepo, mappedReportInstance);
                break;

            case "Set MedDRA and Causality":
                await CreateLinksForTerminologyStepAsync(reportInstanceFromRepo, mappedReportInstance);

                break;

            case "Extract E2B":
                await CreateLinksForE2BStepAsync(reportInstanceFromRepo, mappedReportInstance);

                break;

            default:
                break;
            }

            var validRoles = new string[] { "RegClerk", "DataCap", "Clinician" };

            if (reportInstanceFromRepo.WorkFlow.Description == "New Active Surveilliance Report")
            {
                mappedReportInstance.Links.Add(new LinkDto(_linkGeneratorService.CreateResourceUri("Patient", reportInstanceFromRepo.Id), "viewpatient", "GET"));
            }

            if (reportInstanceFromRepo.WorkFlow.Description == "New Spontaneous Surveilliance Report")
            {
                var datasetInstance = _datasetInstanceRepository.Get(di => di.DatasetInstanceGuid == reportInstanceFromRepo.ContextGuid);
                if (datasetInstance != null)
                {
                    mappedReportInstance.Links.Add(new LinkDto(_linkGeneratorService.CreateUpdateDatasetInstanceResourceUri(
                                                                   datasetInstance.Dataset.Id, datasetInstance.Id), "updatespont", "PUT"));
                }
            }
        }
Пример #7
0
        private AttachmentIdentifierDto CreateLinks(AttachmentIdentifierDto dto)
        {
            dto.Links.Add(new LinkDto(_linkGeneratorService.CreateResourceUri("Attachment", dto.Id), "self", "GET"));

            return(dto);
        }
Пример #8
0
 private void CreateLinksForCohortGroup(CohortGroupPatientDetailDto dto)
 {
     dto.Links.Add(new LinkDto(_linkGeneratorService.CreateResourceUri("CohortGroup", dto.Id), "self", "GET"));
 }
 private void CreateLinks(ConditionIdentifierDto mappedCondition)
 {
     mappedCondition.Links.Add(new LinkDto(_linkGeneratorService.CreateResourceUri("Condition", mappedCondition.Id), "self", "GET"));
 }
Пример #10
0
 private void CreateLinks(PatientIdentifierDto mappedPatient)
 {
     mappedPatient.Links.Add(new LinkDto(_linkGeneratorService.CreateResourceUri("Patient", mappedPatient.Id), "self", "GET"));
     mappedPatient.Links.Add(new LinkDto(_linkGeneratorService.CreateNewAppointmentForPatientResourceUri(mappedPatient.Id), "newAppointment", "POST"));
     mappedPatient.Links.Add(new LinkDto(_linkGeneratorService.CreateNewEnrolmentForPatientResourceUri(mappedPatient.Id), "newEnrolment", "POST"));
 }
Пример #11
0
        private FacilityDetailDto CreateLinks(FacilityDetailDto dto)
        {
            dto.Links.Add(new LinkDto(_linkGeneratorService.CreateResourceUri("Facility", dto.Id), "self", "GET"));

            return(dto);
        }
Пример #12
0
 private void CreateLinks(CohortGroupDetailDto mappedCohortGroup)
 {
     mappedCohortGroup.Links.Add(new LinkDto(_linkGeneratorService.CreateResourceUri("CohortGroup", mappedCohortGroup.Id), "self", "GET"));
 }
Пример #13
0
        private CohortGroupDetailDto CreateLinks(CohortGroupDetailDto dto)
        {
            dto.Links.Add(new LinkDto(_linkGeneratorService.CreateResourceUri("CohortGroup", dto.Id), "self", "GET"));

            return(dto);
        }
Пример #14
0
 private void CreateLinks(ProductDetailDto mappedProduct)
 {
     mappedProduct.Links.Add(new LinkDto(_linkGeneratorService.CreateResourceUri("Product", mappedProduct.Id), "self", "GET"));
 }
        private PatientClinicalEventExpandedDto CreateLinks(PatientClinicalEventExpandedDto mappedPatientClinicalEvent)
        {
            mappedPatientClinicalEvent.Links.Add(new LinkDto(_linkGeneratorService.CreateResourceUri("PatientClinicalEvent", mappedPatientClinicalEvent.Id), "self", "GET"));

            return(mappedPatientClinicalEvent);
        }
Пример #16
0
 private void CreateLinks(UserDetailDto mappedUser)
 {
     mappedUser.Links.Add(new LinkDto(_linkGeneratorService.CreateResourceUri("User", mappedUser.Id), "self", "GET"));
     mappedUser.Links.Add(new LinkDto(_linkGeneratorService.CreateResourceUri("User", mappedUser.Id), "self", "DELETE"));
 }
        private PatientClinicalEventIdentifierDto CreateLinks(PatientClinicalEventIdentifierDto dto)
        {
            dto.Links.Add(new LinkDto(_linkGeneratorService.CreateResourceUri("PatientClinicalEvent", dto.Id), "self", "GET"));

            return(dto);
        }
 private void CreateLinks(CustomAttributeIdentifierDto mappedCustomAttribute)
 {
     mappedCustomAttribute.Links.Add(new LinkDto(_linkGeneratorService.CreateResourceUri("CustomAttribute", mappedCustomAttribute.Id), "self", "GET"));
     mappedCustomAttribute.Links.Add(new LinkDto(_linkGeneratorService.CreateResourceUri("CustomAttribute", mappedCustomAttribute.Id), "self", "DELETE"));
 }
Пример #19
0
 private void CreateLinks(ConceptDetailDto mappedConcept)
 {
     mappedConcept.Links.Add(new LinkDto(_linkGeneratorService.CreateResourceUri("Concept", mappedConcept.Id), "self", "GET"));
 }
Пример #20
0
        private PatientMedicationIdentifierDto CreateLinks(PatientMedicationIdentifierDto mappedPatientMedication)
        {
            mappedPatientMedication.Links.Add(new LinkDto(_linkGeneratorService.CreateResourceUri("PatientMedication", mappedPatientMedication.Id), "self", "GET"));

            return(mappedPatientMedication);
        }
Пример #21
0
        private CohortGroupIdentifierDto CreateLinks(CohortGroupIdentifierDto mappedCohortGroup)
        {
            mappedCohortGroup.Links.Add(new LinkDto(_linkGeneratorService.CreateResourceUri("CohortGroup", mappedCohortGroup.Id), "self", "GET"));

            return(mappedCohortGroup);
        }
 private void CreateLinks(PatientLabTestDetailDto mappedPatientLabTest)
 {
     mappedPatientLabTest.Links.Add(new LinkDto(_linkGeneratorService.CreateResourceUri("PatientLabTest", mappedPatientLabTest.Id), "self", "GET"));
 }
Пример #23
0
 private void CreateLinks(UserIdentifierDto dto)
 {
     dto.Links.Add(new LinkDto(_linkGeneratorService.CreateResourceUri("User", dto.Id), "self", "GET"));
 }
 private void CreateLinks(CustomAttributeDetailDto mappedFacility)
 {
     mappedFacility.Links.Add(new LinkDto(_linkGeneratorService.CreateResourceUri("Facility", mappedFacility.Id), "self", "GET"));
     mappedFacility.Links.Add(new LinkDto(_linkGeneratorService.CreateResourceUri("Facility", mappedFacility.Id), "self", "DELETE"));
 }
        private TaskCommentDto CreateLinks(TaskCommentDto dto)
        {
            dto.Links.Add(new LinkDto(_linkGeneratorService.CreateResourceUri("ReportInstanceTaskComment", dto.Id), "self", "GET"));

            return(dto);
        }
Пример #26
0
        private WorkFlowDetailDto CreateLinks(WorkFlowDetailDto dto)
        {
            dto.Links.Add(new LinkDto(_linkGeneratorService.CreateResourceUri("WorkFlow", dto.Id), "self", "GET"));

            return(dto);
        }
 private void CreateLinks(MedicationFormIdentifierDto mappedConcept)
 {
     mappedConcept.Links.Add(new LinkDto(_linkGeneratorService.CreateResourceUri("MedicationForm", mappedConcept.Id), "self", "GET"));
 }
Пример #28
0
 private void CreateLinks(CustomAttributeIdentifierDto dto)
 {
     dto.Links.Add(new LinkDto(_linkGeneratorService.CreateResourceUri("CustomAttribute", dto.Id), "self", "GET"));
 }
Пример #29
0
        private ProductIdentifierDto CreateLinks(ProductIdentifierDto mappedProduct)
        {
            mappedProduct.Links.Add(new LinkDto(_linkGeneratorService.CreateResourceUri("Product", mappedProduct.Id), "self", "GET"));

            return(mappedProduct);
        }
Пример #30
0
 private void CreateLinks(AppointmentIdentifierDto dto)
 {
     dto.Links.Add(new LinkDto(_linkGeneratorService.CreateResourceUri("Appointment", dto.Id), "self", "GET"));
     dto.Links.Add(new LinkDto(_linkGeneratorService.CreateResourceUri("Appointment", dto.Id), "self", "DELETE"));
 }