Search in sources :

Example 1 with ResultOfCall

use of se.inera.ifv.insuranceprocess.healthreporting.v2.ResultOfCall in project webcert by sklintyg.

the class RegisterMedicalCertificateResponderStub method buildResponse.

private RegisterMedicalCertificateResponseType buildResponse() {
    RegisterMedicalCertificateResponseType responseType = new RegisterMedicalCertificateResponseType();
    ResultOfCall resultOfCall = new ResultOfCall();
    resultOfCall.setResultCode(ResultCodeEnum.OK);
    responseType.setResult(resultOfCall);
    return responseType;
}
Also used : ResultOfCall(se.inera.ifv.insuranceprocess.healthreporting.v2.ResultOfCall) RegisterMedicalCertificateResponseType(se.inera.ifv.insuranceprocess.healthreporting.registermedicalcertificateresponder.v3.RegisterMedicalCertificateResponseType)

Example 2 with ResultOfCall

use of se.inera.ifv.insuranceprocess.healthreporting.v2.ResultOfCall in project webcert by sklintyg.

the class RevokeMedicalCertificateResponderStub method revokeMedicalCertificate.

@Override
@StubModeAware
public RevokeMedicalCertificateResponseType revokeMedicalCertificate(AttributedURIType attributedURIType, RevokeMedicalCertificateRequestType revokeMedicalCertificateRequestType) {
    CertificateHolder certResponseType = intygStore.getIntygForCertificateId(revokeMedicalCertificateRequestType.getRevoke().getLakarutlatande().getLakarutlatandeId());
    RevokeMedicalCertificateResponseType responseType = new RevokeMedicalCertificateResponseType();
    ResultOfCall resultOfCall = new ResultOfCall();
    if (certResponseType == null) {
        resultOfCall.setResultCode(ResultCodeEnum.ERROR);
        resultOfCall.setErrorId(ErrorIdEnum.APPLICATION_ERROR);
        responseType.setResult(resultOfCall);
        return responseType;
    }
    if (!isRevoked(certResponseType.getCertificateStates())) {
        intygStore.addStatus(certResponseType.getId(), new CertificateStateHolder(attributedURIType.getValue(), CertificateState.CANCELLED, LocalDateTime.now()));
    }
    resultOfCall.setResultCode(ResultCodeEnum.OK);
    responseType.setResult(resultOfCall);
    return responseType;
}
Also used : ResultOfCall(se.inera.ifv.insuranceprocess.healthreporting.v2.ResultOfCall) CertificateStateHolder(se.inera.intyg.common.support.modules.support.api.CertificateStateHolder) CertificateHolder(se.inera.intyg.common.support.modules.support.api.CertificateHolder) RevokeMedicalCertificateResponseType(se.inera.ifv.insuranceprocess.healthreporting.revokemedicalcertificateresponder.v1.RevokeMedicalCertificateResponseType) StubModeAware(se.inera.intyg.webcert.intygstjanststub.mode.StubModeAware)

Aggregations

ResultOfCall (se.inera.ifv.insuranceprocess.healthreporting.v2.ResultOfCall)2 RegisterMedicalCertificateResponseType (se.inera.ifv.insuranceprocess.healthreporting.registermedicalcertificateresponder.v3.RegisterMedicalCertificateResponseType)1 RevokeMedicalCertificateResponseType (se.inera.ifv.insuranceprocess.healthreporting.revokemedicalcertificateresponder.v1.RevokeMedicalCertificateResponseType)1 CertificateHolder (se.inera.intyg.common.support.modules.support.api.CertificateHolder)1 CertificateStateHolder (se.inera.intyg.common.support.modules.support.api.CertificateStateHolder)1 StubModeAware (se.inera.intyg.webcert.intygstjanststub.mode.StubModeAware)1