Search in sources :

Example 6 with CertificateHolder

use of se.inera.intyg.common.support.modules.support.api.CertificateHolder in project webcert by sklintyg.

the class RegisterMedicalCertificateResponderStub method buildStubInternalCertificate.

private CertificateHolder buildStubInternalCertificate(RegisterMedicalCertificateType source) {
    CertificateHolder certificate = new CertificateHolder();
    certificate.setId(source.getLakarutlatande().getLakarutlatandeId());
    certificate.setType(source.getLakarutlatande().getTypAvUtlatande());
    certificate.setCivicRegistrationNumber(Personnummer.createPersonnummer(source.getLakarutlatande().getPatient().getPersonId().getExtension()).get());
    certificate.setSignedDate(source.getLakarutlatande().getSigneringsdatum());
    certificate.setCareUnitId(source.getLakarutlatande().getSkapadAvHosPersonal().getEnhet().getEnhetsId().getExtension());
    certificate.setCareUnitName(source.getLakarutlatande().getSkapadAvHosPersonal().getEnhet().getEnhetsnamn());
    certificate.setSigningDoctorName(source.getLakarutlatande().getSkapadAvHosPersonal().getFullstandigtNamn());
    certificate.setAdditionalInfo(source.getLakarutlatande().getKommentar());
    certificate.setCareGiverId(source.getLakarutlatande().getSkapadAvHosPersonal().getEnhet().getVardgivare().getVardgivareId().getExtension());
    return certificate;
}
Also used : CertificateHolder(se.inera.intyg.common.support.modules.support.api.CertificateHolder)

Example 7 with CertificateHolder

use of se.inera.intyg.common.support.modules.support.api.CertificateHolder in project webcert by sklintyg.

the class RegisterTSBasResponderStub method buildStubInternalCertificate.

private CertificateHolder buildStubInternalCertificate(RegisterTSBasType source) {
    CertificateHolder certificate = new CertificateHolder();
    certificate.setId(source.getIntyg().getIntygsId());
    certificate.setType(source.getIntyg().getIntygsTyp());
    certificate.setCivicRegistrationNumber(Personnummer.createPersonnummer(source.getIntyg().getGrundData().getPatient().getPersonId().getExtension()).get());
    certificate.setSignedDate(LocalDateTime.parse(source.getIntyg().getGrundData().getSigneringsTidstampel(), DateTimeFormatter.ISO_LOCAL_DATE_TIME));
    certificate.setCareUnitId(source.getIntyg().getGrundData().getSkapadAv().getVardenhet().getEnhetsId().getExtension());
    certificate.setCareUnitName(source.getIntyg().getGrundData().getSkapadAv().getVardenhet().getEnhetsnamn());
    certificate.setSigningDoctorName(source.getIntyg().getGrundData().getSkapadAv().getFullstandigtNamn());
    certificate.setAdditionalInfo(source.getIntyg().getOvrigKommentar());
    certificate.setCareGiverId(source.getIntyg().getGrundData().getSkapadAv().getVardenhet().getVardgivare().getVardgivarid().getExtension());
    return certificate;
}
Also used : CertificateHolder(se.inera.intyg.common.support.modules.support.api.CertificateHolder)

Example 8 with CertificateHolder

use of se.inera.intyg.common.support.modules.support.api.CertificateHolder 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

CertificateHolder (se.inera.intyg.common.support.modules.support.api.CertificateHolder)8 StubModeAware (se.inera.intyg.webcert.intygstjanststub.mode.StubModeAware)4 StubLatencyAware (se.inera.intyg.webcert.intygstjanststub.mode.StubLatencyAware)3 CertificateStateHolder (se.inera.intyg.common.support.modules.support.api.CertificateStateHolder)2 RevokeMedicalCertificateResponseType (se.inera.ifv.insuranceprocess.healthreporting.revokemedicalcertificateresponder.v1.RevokeMedicalCertificateResponseType)1 ResultOfCall (se.inera.ifv.insuranceprocess.healthreporting.v2.ResultOfCall)1 GetMedicalCertificateResponseType (se.inera.intyg.clinicalprocess.healthcond.certificate.getmedicalcertificate.v1.GetMedicalCertificateResponseType)1 ListCertificatesForCareResponseType (se.riv.clinicalprocess.healthcond.certificate.listcertificatesforcare.v3.ListCertificatesForCareResponseType)1 ListaType (se.riv.clinicalprocess.healthcond.certificate.listcertificatesforcare.v3.ListaType)1 SendCertificateToRecipientResponseType (se.riv.clinicalprocess.healthcond.certificate.sendCertificateToRecipient.v2.SendCertificateToRecipientResponseType)1 HsaId (se.riv.clinicalprocess.healthcond.certificate.types.v3.HsaId)1 Intyg (se.riv.clinicalprocess.healthcond.certificate.v3.Intyg)1 ResultType (se.riv.clinicalprocess.healthcond.certificate.v3.ResultType)1