Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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"));
                }
            }
        }
Exemplo n.º 7
0
        private AttachmentIdentifierDto CreateLinks(AttachmentIdentifierDto dto)
        {
            dto.Links.Add(new LinkDto(_linkGeneratorService.CreateResourceUri("Attachment", dto.Id), "self", "GET"));

            return(dto);
        }
Exemplo n.º 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"));
 }
Exemplo n.º 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"));
 }
Exemplo n.º 11
0
        private FacilityDetailDto CreateLinks(FacilityDetailDto dto)
        {
            dto.Links.Add(new LinkDto(_linkGeneratorService.CreateResourceUri("Facility", dto.Id), "self", "GET"));

            return(dto);
        }
Exemplo n.º 12
0
 private void CreateLinks(CohortGroupDetailDto mappedCohortGroup)
 {
     mappedCohortGroup.Links.Add(new LinkDto(_linkGeneratorService.CreateResourceUri("CohortGroup", mappedCohortGroup.Id), "self", "GET"));
 }
Exemplo n.º 13
0
        private CohortGroupDetailDto CreateLinks(CohortGroupDetailDto dto)
        {
            dto.Links.Add(new LinkDto(_linkGeneratorService.CreateResourceUri("CohortGroup", dto.Id), "self", "GET"));

            return(dto);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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"));
 }
Exemplo n.º 19
0
 private void CreateLinks(ConceptDetailDto mappedConcept)
 {
     mappedConcept.Links.Add(new LinkDto(_linkGeneratorService.CreateResourceUri("Concept", mappedConcept.Id), "self", "GET"));
 }
Exemplo n.º 20
0
        private PatientMedicationIdentifierDto CreateLinks(PatientMedicationIdentifierDto mappedPatientMedication)
        {
            mappedPatientMedication.Links.Add(new LinkDto(_linkGeneratorService.CreateResourceUri("PatientMedication", mappedPatientMedication.Id), "self", "GET"));

            return(mappedPatientMedication);
        }
Exemplo n.º 21
0
        private CohortGroupIdentifierDto CreateLinks(CohortGroupIdentifierDto mappedCohortGroup)
        {
            mappedCohortGroup.Links.Add(new LinkDto(_linkGeneratorService.CreateResourceUri("CohortGroup", mappedCohortGroup.Id), "self", "GET"));

            return(mappedCohortGroup);
        }
Exemplo n.º 22
0
 private void CreateLinks(PatientLabTestDetailDto mappedPatientLabTest)
 {
     mappedPatientLabTest.Links.Add(new LinkDto(_linkGeneratorService.CreateResourceUri("PatientLabTest", mappedPatientLabTest.Id), "self", "GET"));
 }
Exemplo n.º 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);
        }
Exemplo n.º 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"));
 }
Exemplo n.º 28
0
 private void CreateLinks(CustomAttributeIdentifierDto dto)
 {
     dto.Links.Add(new LinkDto(_linkGeneratorService.CreateResourceUri("CustomAttribute", dto.Id), "self", "GET"));
 }
Exemplo n.º 29
0
        private ProductIdentifierDto CreateLinks(ProductIdentifierDto mappedProduct)
        {
            mappedProduct.Links.Add(new LinkDto(_linkGeneratorService.CreateResourceUri("Product", mappedProduct.Id), "self", "GET"));

            return(mappedProduct);
        }
Exemplo n.º 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"));
 }