use of se.riv.clinicalprocess.healthcond.certificate.sendMessageToRecipient.v2.SendMessageToRecipientType in project webcert by sklintyg.
the class SendMessageToRecipientTypeBuilder method build.
public static SendMessageToRecipientType build(Arende arende, WebCertUser skickatAv, String logiskAdressMottagare) {
SendMessageToRecipientType request = new SendMessageToRecipientType();
request.setAmne(buildAmne(arende));
request.setIntygsId(buildIntygId(arende));
request.setLogiskAdressMottagare(logiskAdressMottagare);
request.setMeddelande(arende.getMeddelande());
request.setMeddelandeId(arende.getMeddelandeId());
request.setPaminnelseMeddelandeId(arende.getPaminnelseMeddelandeId());
request.setPatientPersonId(InternalConverterUtil.getPersonId(createPnr(arende.getPatientPersonId())));
request.setReferensId(arende.getReferensId());
request.setRubrik(arende.getRubrik());
request.setSistaDatumForSvar(arende.getSistaDatumForSvar());
request.setSkickatAv(buildHosPersonalFromWebCertUser(skickatAv));
request.setSkickatTidpunkt(arende.getSkickatTidpunkt());
decorateWithSvarPa(request, arende);
return request;
}
use of se.riv.clinicalprocess.healthcond.certificate.sendMessageToRecipient.v2.SendMessageToRecipientType in project webcert by sklintyg.
the class SendMessageToRecipientTypeBuilderTest method buildTest.
@Test
public void buildTest() {
final Arende arende = buildArende();
final WebCertUser skickatAv = buildWebCertUser(true);
final String logiskAdressMottagare = "logical address";
SendMessageToRecipientType result = SendMessageToRecipientTypeBuilder.build(arende, skickatAv, logiskAdressMottagare);
assertNotNull(result);
assertEquals(logiskAdressMottagare, result.getLogiskAdressMottagare());
assertEquals(AMNE.name(), result.getAmne().getCode());
assertEquals(AMNE.getDescription(), result.getAmne().getDisplayName());
assertNotNull(result.getAmne().getCodeSystem());
assertEquals(MEDDELANDE, result.getMeddelande());
assertEquals(MEDDELANDE_ID, result.getMeddelandeId());
assertEquals(PAMINNELSE_MEDDELANDE_ID, result.getPaminnelseMeddelandeId());
assertEquals(PATIENT_PERSON_ID, result.getPatientPersonId().getExtension());
assertNotNull(result.getPatientPersonId().getRoot());
assertEquals(REFERENS_ID, result.getReferensId());
assertEquals(RUBRIK, result.getRubrik());
assertEquals(SISTA_DATUM_FOR_SVAR, result.getSistaDatumForSvar());
assertEquals(SKICKAT_TIDPUNKT, result.getSkickatTidpunkt());
assertEquals(SVAR_PA_ID, result.getSvarPa().getMeddelandeId());
assertEquals(SVAR_PA_REFERENS, result.getSvarPa().getReferensId());
assertEquals(ENHET_ID, result.getIntygsId().getRoot());
assertEquals(INTYG_ID, result.getIntygsId().getExtension());
assertEquals(PERSONAL_HSA_ID, result.getSkickatAv().getPersonalId().getExtension());
assertNotNull(result.getSkickatAv().getPersonalId().getRoot());
assertEquals(USER_NAMN, result.getSkickatAv().getFullstandigtNamn());
assertEquals(USER_FORSKRIVARKOD, result.getSkickatAv().getForskrivarkod());
assertEquals(ARBETSPLATSKOD, result.getSkickatAv().getEnhet().getArbetsplatskod().getExtension());
assertNotNull(result.getSkickatAv().getEnhet().getArbetsplatskod().getRoot());
assertEquals(VARDENHET_EPOST, result.getSkickatAv().getEnhet().getEpost());
assertEquals(VARDENHET_ENHET_ID, result.getSkickatAv().getEnhet().getEnhetsId().getExtension());
assertNotNull(result.getSkickatAv().getEnhet().getEnhetsId().getRoot());
assertEquals(VARDENHET_NAMN, result.getSkickatAv().getEnhet().getEnhetsnamn());
assertEquals(VARDENHET_POSTADRESS, result.getSkickatAv().getEnhet().getPostadress());
assertEquals(VARDENHET_POSTNUMMER, result.getSkickatAv().getEnhet().getPostnummer());
assertEquals(VARDENHET_POSTORT, result.getSkickatAv().getEnhet().getPostort());
assertEquals(VARDENHET_TELEFONNUMMER, result.getSkickatAv().getEnhet().getTelefonnummer());
assertEquals(VARDGIVARE_ID, result.getSkickatAv().getEnhet().getVardgivare().getVardgivareId().getExtension());
assertNotNull(result.getSkickatAv().getEnhet().getVardgivare().getVardgivareId().getRoot());
assertEquals(VARDGIVARE_NAMN, result.getSkickatAv().getEnhet().getVardgivare().getVardgivarnamn());
}
use of se.riv.clinicalprocess.healthcond.certificate.sendMessageToRecipient.v2.SendMessageToRecipientType in project webcert by sklintyg.
the class SendMessageToRecipientTypeBuilderTest method buildQuestionTest.
@Test
public void buildQuestionTest() {
final Arende arende = buildArende();
// question
arende.setSvarPaId(null);
final WebCertUser skickatAv = buildWebCertUser(true);
final String logiskAdressMottagare = "logical address";
SendMessageToRecipientType result = SendMessageToRecipientTypeBuilder.build(arende, skickatAv, logiskAdressMottagare);
assertNotNull(result);
assertEquals(AMNE.name(), result.getAmne().getCode());
assertNull(result.getSvarPa());
}
use of se.riv.clinicalprocess.healthcond.certificate.sendMessageToRecipient.v2.SendMessageToRecipientType in project webcert by sklintyg.
the class SendMessageToRecipientTypeBuilderTest method buildTestNullToEmptyString.
@Test
public void buildTestNullToEmptyString() {
final Arende arende = buildArende();
final WebCertUser skickatAv = buildWebCertUser(false);
final String logiskAdressMottagare = "logical address";
SendMessageToRecipientType result = SendMessageToRecipientTypeBuilder.build(arende, skickatAv, logiskAdressMottagare);
assertEquals("", result.getSkickatAv().getEnhet().getEnhetsnamn());
assertEquals("", result.getSkickatAv().getEnhet().getPostadress());
assertEquals("", result.getSkickatAv().getEnhet().getPostnummer());
assertEquals("", result.getSkickatAv().getEnhet().getPostort());
assertEquals("", result.getSkickatAv().getEnhet().getTelefonnummer());
assertNull(result.getSkickatAv().getEnhet().getEpost());
assertEquals("", result.getSkickatAv().getEnhet().getVardgivare().getVardgivarnamn());
}
Aggregations