Search in sources :

Example 1 with AcsPermission

use of uk.nhs.adaptors.scr.models.AcsPermission in project summary-care-record-api by NHSDigital.

the class AcsService method getPermission.

private static AcsPermission getPermission(ParametersParameterComponent parameter) {
    Coding coding = (Coding) parameter.getPart().stream().filter(p -> PERMISSION_CODE_PART_NAME.equals(p.getName())).filter(p -> PERMISSION_CODE_SYSTEM.equals(((Coding) p.getValue()).getSystem())).findFirst().get().getValue();
    String permissionValue = coding.getCode();
    return AcsPermission.fromValue(permissionValue);
}
Also used : SpineClientContract(uk.nhs.adaptors.scr.clients.spine.SpineClientContract) IdentityServiceContract(uk.nhs.adaptors.scr.clients.identity.IdentityServiceContract) Mustache(com.github.mustachejava.Mustache) RequiredArgsConstructor(lombok.RequiredArgsConstructor) Response(uk.nhs.adaptors.scr.clients.spine.SpineHttpClient.Response) Autowired(org.springframework.beans.factory.annotation.Autowired) RequestData(uk.nhs.adaptors.scr.models.RequestData) OffsetDateTime.now(java.time.OffsetDateTime.now) FhirParser(uk.nhs.adaptors.scr.components.FhirParser) AcsParams(uk.nhs.adaptors.scr.models.AcsParams) AcsPermission(uk.nhs.adaptors.scr.models.AcsPermission) BadRequestException(uk.nhs.adaptors.scr.exceptions.BadRequestException) UserInfo(uk.nhs.adaptors.scr.clients.identity.UserInfo) Document(org.w3c.dom.Document) SpineConfiguration(uk.nhs.adaptors.scr.config.SpineConfiguration) TemplateUtils.loadTemplate(uk.nhs.adaptors.scr.utils.TemplateUtils.loadTemplate) ParametersParameterComponent(org.hl7.fhir.r4.model.Parameters.ParametersParameterComponent) TemplateUtils.fillTemplate(uk.nhs.adaptors.scr.utils.TemplateUtils.fillTemplate) ScrConfiguration(uk.nhs.adaptors.scr.config.ScrConfiguration) CORRELATION_ID_MDC_KEY(uk.nhs.adaptors.scr.config.ConversationIdFilter.CORRELATION_ID_MDC_KEY) Slf4j(lombok.extern.slf4j.Slf4j) Component(org.springframework.stereotype.Component) Coding(org.hl7.fhir.r4.model.Coding) MDC(org.slf4j.MDC) DateTimeFormatter(java.time.format.DateTimeFormatter) UTC(java.time.ZoneOffset.UTC) Parameters(org.hl7.fhir.r4.model.Parameters) Coding(org.hl7.fhir.r4.model.Coding)

Aggregations

Mustache (com.github.mustachejava.Mustache)1 OffsetDateTime.now (java.time.OffsetDateTime.now)1 UTC (java.time.ZoneOffset.UTC)1 DateTimeFormatter (java.time.format.DateTimeFormatter)1 RequiredArgsConstructor (lombok.RequiredArgsConstructor)1 Slf4j (lombok.extern.slf4j.Slf4j)1 Coding (org.hl7.fhir.r4.model.Coding)1 Parameters (org.hl7.fhir.r4.model.Parameters)1 ParametersParameterComponent (org.hl7.fhir.r4.model.Parameters.ParametersParameterComponent)1 MDC (org.slf4j.MDC)1 Autowired (org.springframework.beans.factory.annotation.Autowired)1 Component (org.springframework.stereotype.Component)1 Document (org.w3c.dom.Document)1 IdentityServiceContract (uk.nhs.adaptors.scr.clients.identity.IdentityServiceContract)1 UserInfo (uk.nhs.adaptors.scr.clients.identity.UserInfo)1 SpineClientContract (uk.nhs.adaptors.scr.clients.spine.SpineClientContract)1 Response (uk.nhs.adaptors.scr.clients.spine.SpineHttpClient.Response)1 FhirParser (uk.nhs.adaptors.scr.components.FhirParser)1 CORRELATION_ID_MDC_KEY (uk.nhs.adaptors.scr.config.ConversationIdFilter.CORRELATION_ID_MDC_KEY)1 ScrConfiguration (uk.nhs.adaptors.scr.config.ScrConfiguration)1