@Test public void testConvert() throws Exception { final String intygsId = "intygsid"; final String enhetsId = "enhetsid"; final String enhetsnamn = "enhetsnamn"; final String patientPersonId = "201212121212"; final String skapadAvFullstandigtNamn = "fullständigt namn"; final String skapadAvPersonId = "skapad av pid"; final String arbetsplatsKod = "arbetsplatsKod"; final String postadress = "postadress"; final String postNummer = "postNummer"; final String postOrt = "postOrt"; final String epost = "epost"; final String telefonNummer = "telefonNummer"; final String vardgivarid = "vardgivarid"; final String vardgivarNamn = "vardgivarNamn"; final String forskrivarKod = "forskrivarKod"; final String recipient = "TRANSP"; HoSPersonal skickatAv = buildHosPersonal(enhetsId, enhetsnamn, skapadAvFullstandigtNamn, skapadAvPersonId, arbetsplatsKod, postadress, postNummer, postOrt, epost, telefonNummer, vardgivarid, vardgivarNamn, forskrivarKod); SendCertificateToRecipientType result = SendCertificateToRecipientTypeConverter.convert(intygsId, patientPersonId, skickatAv, recipient); assertNotNull(result.getIntygsId().getRoot()); assertEquals(intygsId, result.getIntygsId().getExtension()); assertNotNull(result.getPatientPersonId().getRoot()); assertEquals(patientPersonId, result.getPatientPersonId().getExtension()); assertEquals(skapadAvFullstandigtNamn, result.getSkickatAv().getHosPersonal().getFullstandigtNamn()); assertNotNull(result.getSkickatAv().getHosPersonal().getPersonalId().getRoot()); assertEquals(skapadAvPersonId, result.getSkickatAv().getHosPersonal().getPersonalId().getExtension()); assertNotNull(result.getSkickatAv().getHosPersonal().getEnhet().getEnhetsId().getRoot()); assertEquals(enhetsId, result.getSkickatAv().getHosPersonal().getEnhet().getEnhetsId().getExtension()); assertNotNull(result.getSkickatAv().getHosPersonal().getEnhet().getEnhetsId().getExtension()); assertEquals(enhetsnamn, result.getSkickatAv().getHosPersonal().getEnhet().getEnhetsnamn()); assertNotNull(result.getSkickatAv().getHosPersonal().getEnhet().getArbetsplatskod().getRoot()); assertEquals(arbetsplatsKod, result.getSkickatAv().getHosPersonal().getEnhet().getArbetsplatskod().getExtension()); assertEquals(postadress, result.getSkickatAv().getHosPersonal().getEnhet().getPostadress()); assertEquals(postNummer, result.getSkickatAv().getHosPersonal().getEnhet().getPostnummer()); assertEquals(postOrt, result.getSkickatAv().getHosPersonal().getEnhet().getPostort()); assertEquals(epost, result.getSkickatAv().getHosPersonal().getEnhet().getEpost()); assertEquals(telefonNummer, result.getSkickatAv().getHosPersonal().getEnhet().getTelefonnummer()); assertNotNull(result.getSkickatAv().getHosPersonal().getEnhet().getVardgivare().getVardgivareId().getRoot()); assertEquals(vardgivarid, result.getSkickatAv().getHosPersonal().getEnhet().getVardgivare().getVardgivareId().getExtension()); assertEquals(vardgivarNamn, result.getSkickatAv().getHosPersonal().getEnhet().getVardgivare().getVardgivarnamn()); assertEquals(forskrivarKod, result.getSkickatAv().getHosPersonal().getForskrivarkod()); assertNotNull(result.getSkickatTidpunkt()); assertNotNull(result.getMottagare().getCodeSystem()); assertEquals("TRANSP", result.getMottagare().getCode()); }
public static SendCertificateToRecipientType convert(String intygsId, String personnummer, HoSPersonal skickatAv, String recipient) { SendCertificateToRecipientType request = new SendCertificateToRecipientType(); request.setSkickatTidpunkt(LocalDateTime.now()); request.setIntygsId(buildIntygId(intygsId)); request.setPatientPersonId(InternalConverterUtil.getPersonId(createPnr(personnummer))); request.setMottagare(buildPart(recipient)); request.setSkickatAv(buildSkickatAv(skickatAv)); return request; }
SendCertificateToRecipientTypeConverter { public static SendCertificateToRecipientType convert(String intygsId, String personnummer, HoSPersonal skickatAv, String recipient) { SendCertificateToRecipientType request = new SendCertificateToRecipientType(); request.setSkickatTidpunkt(LocalDateTime.now()); request.setIntygsId(buildIntygId(intygsId)); request.setPatientPersonId(InternalConverterUtil.getPersonId(createPnr(personnummer))); request.setMottagare(buildPart(recipient)); request.setSkickatAv(buildSkickatAv(skickatAv)); return request; } }
SendCertificateToRecipientTypeConverter { public static SendCertificateToRecipientType convert(String intygsId, String personnummer, HoSPersonal skickatAv, String recipient) { SendCertificateToRecipientType request = new SendCertificateToRecipientType(); request.setSkickatTidpunkt(LocalDateTime.now()); request.setIntygsId(buildIntygId(intygsId)); request.setPatientPersonId(InternalConverterUtil.getPersonId(createPnr(personnummer))); request.setMottagare(buildPart(recipient)); request.setSkickatAv(buildSkickatAv(skickatAv)); return request; } private  SendCertificateToRecipientTypeConverter(); }
SendCertificateToRecipientTypeConverter { public static SendCertificateToRecipientType convert(String intygsId, String personnummer, HoSPersonal skickatAv, String recipient) { SendCertificateToRecipientType request = new SendCertificateToRecipientType(); request.setSkickatTidpunkt(LocalDateTime.now()); request.setIntygsId(buildIntygId(intygsId)); request.setPatientPersonId(InternalConverterUtil.getPersonId(createPnr(personnummer))); request.setMottagare(buildPart(recipient)); request.setSkickatAv(buildSkickatAv(skickatAv)); return request; } private  SendCertificateToRecipientTypeConverter(); static SendCertificateToRecipientType convert(String intygsId, String personnummer, HoSPersonal skickatAv, String recipient); }
SendCertificateToRecipientTypeConverter { public static SendCertificateToRecipientType convert(String intygsId, String personnummer, HoSPersonal skickatAv, String recipient) { SendCertificateToRecipientType request = new SendCertificateToRecipientType(); request.setSkickatTidpunkt(LocalDateTime.now()); request.setIntygsId(buildIntygId(intygsId)); request.setPatientPersonId(InternalConverterUtil.getPersonId(createPnr(personnummer))); request.setMottagare(buildPart(recipient)); request.setSkickatAv(buildSkickatAv(skickatAv)); return request; } private  SendCertificateToRecipientTypeConverter(); static SendCertificateToRecipientType convert(String intygsId, String personnummer, HoSPersonal skickatAv, String recipient);  }