Search in sources :

Example 1 with ResultType

use of se.riv.clinicalprocess.healthcond.certificate.v1.ResultType in project ddf by codice.

the class CswQueryResponseTransformer method buildCollection.

private CswRecordCollection buildCollection(SourceResponse sourceResponse, Map<String, Serializable> arguments) {
    CswRecordCollection recordCollection = new CswRecordCollection();
    recordCollection.setNumberOfRecordsMatched(sourceResponse.getHits());
    recordCollection.setNumberOfRecordsReturned(sourceResponse.getResults().size());
    recordCollection.setStartPosition(sourceResponse.getRequest().getQuery().getStartIndex());
    Object elementSetTypeArg = arguments.get(CswConstants.ELEMENT_SET_TYPE);
    if (elementSetTypeArg instanceof ElementSetType) {
        ElementSetType elementSetType = (ElementSetType) elementSetTypeArg;
        recordCollection.setElementSetType(elementSetType);
    }
    Object elementNamesArg = arguments.get(CswConstants.ELEMENT_NAMES);
    if (elementNamesArg instanceof QName[]) {
        QName[] qnames = (QName[]) elementNamesArg;
        if (qnames.length > 0) {
            List<QName> elementNames = new ArrayList();
            for (QName entry : qnames) {
                elementNames.add(entry);
            }
            recordCollection.setElementName(elementNames);
        }
    }
    Object isByIdQuery = arguments.get(CswConstants.IS_BY_ID_QUERY);
    if (isByIdQuery != null) {
        recordCollection.setById((Boolean) isByIdQuery);
    }
    Object arg = arguments.get((CswConstants.GET_RECORDS));
    if (arg != null && arg instanceof GetRecordsType) {
        recordCollection.setRequest((GetRecordsType) arg);
    }
    Object resultType = arguments.get(CswConstants.RESULT_TYPE_PARAMETER);
    if (resultType instanceof ResultType) {
        recordCollection.setResultType((ResultType) resultType);
    }
    Object outputSchema = arguments.get(CswConstants.OUTPUT_SCHEMA_PARAMETER);
    if (outputSchema instanceof String) {
        recordCollection.setOutputSchema((String) outputSchema);
    } else {
        recordCollection.setOutputSchema(CswConstants.CSW_OUTPUT_SCHEMA);
    }
    Object doWriteNamespaces = arguments.get(CswConstants.WRITE_NAMESPACES);
    if (doWriteNamespaces instanceof Boolean) {
        recordCollection.setDoWriteNamespaces((Boolean) doWriteNamespaces);
    }
    return recordCollection;
}
Also used : QName(javax.xml.namespace.QName) ElementSetType(net.opengis.cat.csw.v_2_0_2.ElementSetType) CswRecordCollection(org.codice.ddf.spatial.ogc.csw.catalog.common.CswRecordCollection) ArrayList(java.util.ArrayList) GetRecordsType(net.opengis.cat.csw.v_2_0_2.GetRecordsType) ResultType(net.opengis.cat.csw.v_2_0_2.ResultType)

Example 2 with ResultType

use of se.riv.clinicalprocess.healthcond.certificate.v1.ResultType in project webcert by sklintyg.

the class SendCertificateToRecipientResponderStub method sendCertificateToRecipient.

@Override
@StubLatencyAware
@StubModeAware
public SendCertificateToRecipientResponseType sendCertificateToRecipient(String logicalAddress, SendCertificateToRecipientType parameters) {
    CertificateHolder fromStore = intygStore.getIntygForCertificateId(parameters.getIntygsId().getExtension());
    SendCertificateToRecipientResponseType responseType = new SendCertificateToRecipientResponseType();
    if (fromStore == null) {
        ResultType resultOfCall = new ResultType();
        resultOfCall.setResultCode(ResultCodeType.ERROR);
        resultOfCall.setErrorId(ErrorIdType.APPLICATION_ERROR);
        responseType.setResult(resultOfCall);
        return responseType;
    }
    intygStore.addStatus(parameters.getIntygsId().getExtension(), new CertificateStateHolder("FKASSA", CertificateState.SENT, LocalDateTime.now()));
    ResultType resultType = new ResultType();
    resultType.setResultCode(ResultCodeType.OK);
    responseType.setResult(resultType);
    return responseType;
}
Also used : SendCertificateToRecipientResponseType(se.riv.clinicalprocess.healthcond.certificate.sendCertificateToRecipient.v2.SendCertificateToRecipientResponseType) CertificateStateHolder(se.inera.intyg.common.support.modules.support.api.CertificateStateHolder) CertificateHolder(se.inera.intyg.common.support.modules.support.api.CertificateHolder) ResultType(se.riv.clinicalprocess.healthcond.certificate.v3.ResultType) StubModeAware(se.inera.intyg.webcert.intygstjanststub.mode.StubModeAware) StubLatencyAware(se.inera.intyg.webcert.intygstjanststub.mode.StubLatencyAware)

Example 3 with ResultType

use of se.riv.clinicalprocess.healthcond.certificate.v1.ResultType in project webcert by sklintyg.

the class SendCertificateServiceClientTest method buildResultOfCall.

private ResultType buildResultOfCall(ResultCodeType resultCodeType) {
    ResultType roc = new ResultType();
    roc.setResultCode(resultCodeType);
    return roc;
}
Also used : ResultType(se.riv.clinicalprocess.healthcond.certificate.v3.ResultType)

Example 4 with ResultType

use of se.riv.clinicalprocess.healthcond.certificate.v1.ResultType in project webcert by sklintyg.

the class CertificateStatusUpdateForCareResponderStub method certificateStatusUpdateForCare.

@Override
public CertificateStatusUpdateForCareResponseType certificateStatusUpdateForCare(String logicalAddress, CertificateStatusUpdateForCareType request) {
    counter.incrementAndGet();
    String utlatandeId = getUtlatandeId(request);
    LOG.debug("utlatandeId: " + utlatandeId);
    LOG.debug("numberOfReceivedMessages: " + getNumberOfReceivedMessages());
    if (utlatandeId.startsWith(FALLERAT_MEDDELANDE)) {
        int attempts = increaseAttempts(utlatandeId);
        int numberOfRequestedFailedAttempts = Integer.parseInt(utlatandeId.substring(utlatandeId.length() - 1));
        LOG.debug("attempts: " + attempts);
        LOG.debug("numberOfRequestedFailedAttempts: " + numberOfRequestedFailedAttempts);
        if (attempts < numberOfRequestedFailedAttempts + 1) {
            throw new RuntimeException("Something went wrong");
        }
    }
    store.add(request);
    CertificateStatusUpdateForCareResponseType response = new CertificateStatusUpdateForCareResponseType();
    ResultType result = new ResultType();
    result.setResultCode(ResultCodeType.OK);
    response.setResult(result);
    LOG.debug("Request set to 'OK'");
    return response;
}
Also used : CertificateStatusUpdateForCareResponseType(se.riv.clinicalprocess.healthcond.certificate.certificatestatusupdateforcareresponder.v3.CertificateStatusUpdateForCareResponseType) ResultType(se.riv.clinicalprocess.healthcond.certificate.v3.ResultType)

Example 5 with ResultType

use of se.riv.clinicalprocess.healthcond.certificate.v1.ResultType in project webcert by sklintyg.

the class NotificationWSClientTest method buildResponse.

private CertificateStatusUpdateForCareResponseType buildResponse(ResultCodeType code, ErrorIdType errorId, String resultText) {
    CertificateStatusUpdateForCareResponseType res = new CertificateStatusUpdateForCareResponseType();
    res.setResult(new ResultType());
    res.getResult().setResultCode(code);
    res.getResult().setErrorId(errorId);
    res.getResult().setResultText(resultText);
    return res;
}
Also used : CertificateStatusUpdateForCareResponseType(se.riv.clinicalprocess.healthcond.certificate.certificatestatusupdateforcareresponder.v3.CertificateStatusUpdateForCareResponseType) ResultType(se.riv.clinicalprocess.healthcond.certificate.v3.ResultType)

Aggregations

ResultType (se.riv.clinicalprocess.healthcond.certificate.v3.ResultType)12 PermanentException (se.inera.intyg.webcert.common.sender.exception.PermanentException)4 TemporaryException (se.inera.intyg.webcert.common.sender.exception.TemporaryException)4 SendCertificateToRecipientResponseType (se.riv.clinicalprocess.healthcond.certificate.sendCertificateToRecipient.v2.SendCertificateToRecipientResponseType)4 CertificateStatusUpdateForCareResponseType (se.riv.clinicalprocess.healthcond.certificate.certificatestatusupdateforcareresponder.v3.CertificateStatusUpdateForCareResponseType)3 ResultType (se.riv.clinicalprocess.healthcond.certificate.v1.ResultType)3 WebServiceException (javax.xml.ws.WebServiceException)2 CreateDraftCertificateResponseType (se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v1.CreateDraftCertificateResponseType)2 CreateDraftCertificateResponseType (se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v3.CreateDraftCertificateResponseType)2 ArrayList (java.util.ArrayList)1 JAXBException (javax.xml.bind.JAXBException)1 QName (javax.xml.namespace.QName)1 ElementSetType (net.opengis.cat.csw.v_2_0_2.ElementSetType)1 GetRecordsType (net.opengis.cat.csw.v_2_0_2.GetRecordsType)1 ResultType (net.opengis.cat.csw.v_2_0_2.ResultType)1 CswRecordCollection (org.codice.ddf.spatial.ogc.csw.catalog.common.CswRecordCollection)1 CertificateHolder (se.inera.intyg.common.support.modules.support.api.CertificateHolder)1 CertificateStateHolder (se.inera.intyg.common.support.modules.support.api.CertificateStateHolder)1 WebCertServiceException (se.inera.intyg.webcert.common.service.exception.WebCertServiceException)1 StubLatencyAware (se.inera.intyg.webcert.intygstjanststub.mode.StubLatencyAware)1