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;
}
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;
}
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;
}
Aggregations