use of se.inera.intyg.infra.integration.hsa.model.Vardgivare in project webcert by sklintyg.
the class StatisticsGroupByUtilTest method buildUserOfRole.
private WebCertUser buildUserOfRole(Role role) {
WebCertUser user = new WebCertUser();
user.setRoles(AuthoritiesResolverUtil.toMap(role));
user.setAuthorities(AuthoritiesResolverUtil.toMap(role.getPrivileges(), Privilege::getName));
user.setOrigin(UserOriginType.DJUPINTEGRATION.name());
user.setHsaId("testuser");
user.setNamn("test userman");
Vardenhet vardenhet = new Vardenhet(HSA1, "enhet");
Vardgivare vardgivare = new Vardgivare("vardgivare", "Vardgivaren");
vardgivare.getVardenheter().add(vardenhet);
user.setVardgivare(Collections.singletonList(vardgivare));
user.setValdVardenhet(vardenhet);
return user;
}
use of se.inera.intyg.infra.integration.hsa.model.Vardgivare in project webcert by sklintyg.
the class UtkastServiceImplTest method createUser.
private WebCertUser createUser() {
Role role = AUTHORITIES_RESOLVER.getRole(AuthoritiesConstants.ROLE_LAKARE);
WebCertUser user = new WebCertUser();
user.setRoles(AuthoritiesResolverUtil.toMap(role));
user.setAuthorities(AuthoritiesResolverUtil.toMap(role.getPrivileges(), Privilege::getName));
user.setHsaId("hsaId");
user.setNamn("namn");
List<String> tmp = new ArrayList<>();
tmp.add("Ortoped");
user.setSpecialiseringar(tmp);
user.setTitel("Befattning");
Vardgivare vardgivare = new Vardgivare();
vardgivare.setId("vardgivarid");
vardgivare.setNamn("vardgivarnamn");
user.setValdVardgivare(vardgivare);
Vardenhet vardenhet = new Vardenhet();
vardenhet.setId(UTKAST_ENHETS_ID);
vardenhet.setNamn("enhetnamn");
user.setValdVardenhet(vardenhet);
vardgivare.setVardenheter(Arrays.asList(vardenhet));
user.setVardgivare(Arrays.asList(vardgivare));
user.setParameters(new IntegrationParameters(USER_REFERENCE, "", "", "", "", "", "", "", "", false, false, false, true));
return user;
}
use of se.inera.intyg.infra.integration.hsa.model.Vardgivare in project webcert by sklintyg.
the class UtkastServiceImplTest method setup.
@Before
public void setup() {
hoSPerson = new HoSPersonal();
hoSPerson.setPersonId("AAA");
hoSPerson.setFullstandigtNamn("Dr Dengroth");
hoSPerson.getBefattningar().add("Befattning");
hoSPerson.getSpecialiteter().add("Ortoped");
defaultPatient = new Patient();
defaultPatient.setPersonId(PERSONNUMMER);
defaultPatient.setFornamn("fornamn");
defaultPatient.setMellannamn("mellannamn");
defaultPatient.setPostadress("pa1");
defaultPatient.setPostnummer("0000");
defaultPatient.setPostort("ort");
se.inera.intyg.common.support.model.common.internal.Vardgivare vardgivare = new se.inera.intyg.common.support.model.common.internal.Vardgivare();
vardgivare.setVardgivarid("SE234234");
vardgivare.setVardgivarnamn("Vårdgivaren");
se.inera.intyg.common.support.model.common.internal.Vardenhet vardenhet = new se.inera.intyg.common.support.model.common.internal.Vardenhet();
vardenhet.setArbetsplatsKod("00000");
vardenhet.setEnhetsnamn("Vårdenheten");
vardenhet.setEnhetsid("SE234897348");
vardenhet.setPostadress("Sjukvägen 1");
vardenhet.setPostnummer("12345");
vardenhet.setPostort("Testberga");
vardenhet.setTelefonnummer("0123-456789");
vardenhet.setEpost("ingen@ingen.se");
vardenhet.setVardgivare(vardgivare);
VardpersonReferens vardperson = new VardpersonReferens();
vardperson.setHsaId(hoSPerson.getPersonId());
vardperson.setNamn(hoSPerson.getFullstandigtNamn());
hoSPerson.setVardenhet(vardenhet);
utkast = createUtkast(INTYG_ID, UTKAST_VERSION, INTYG_TYPE, UtkastStatus.DRAFT_INCOMPLETE, INTYG_JSON, vardperson, PERSONNUMMER);
signedUtkast = createUtkast(INTYG_ID, INTYG_VERSION, INTYG_TYPE, UtkastStatus.SIGNED, INTYG_JSON, vardperson, PERSONNUMMER);
}
use of se.inera.intyg.infra.integration.hsa.model.Vardgivare in project webcert by sklintyg.
the class SignaturServiceImplTest method setup.
@Before
public void setup() throws Exception {
hoSPerson = new HoSPersonal();
hoSPerson.setPersonId("AAA");
hoSPerson.setFullstandigtNamn("Dr Dengroth");
VardpersonReferens vardperson = new VardpersonReferens();
vardperson.setHsaId(hoSPerson.getPersonId());
vardperson.setNamn(hoSPerson.getFullstandigtNamn());
utkast = createUtkast(INTYG_ID, 1, INTYG_TYPE, UtkastStatus.DRAFT_INCOMPLETE, INTYG_JSON, vardperson, ENHET_ID, PERSON_ID);
completedUtkast = createUtkast(INTYG_ID, 2, INTYG_TYPE, UtkastStatus.DRAFT_COMPLETE, INTYG_JSON, vardperson, ENHET_ID, PERSON_ID);
signedUtkast = createUtkast(INTYG_ID, 3, INTYG_TYPE, UtkastStatus.SIGNED, INTYG_JSON, vardperson, ENHET_ID, PERSON_ID);
vardenhet = new Vardenhet(ENHET_ID, "testNamn");
vardgivare = new Vardgivare("123", "vardgivare");
vardgivare.setVardenheter(Collections.singletonList(vardenhet));
user = createWebCertUser(true);
when(webcertUserService.getUser()).thenReturn(user);
when(moduleRegistry.getModuleApi(any())).thenReturn(moduleApi);
when(moduleApi.updateBeforeSigning(any(), any(), any())).thenReturn(INTYG_JSON);
Utlatande utlatande = mock(Utlatande.class);
GrundData grunddata = new GrundData();
grunddata.setSkapadAv(new HoSPersonal());
when(utlatande.getGrundData()).thenReturn(grunddata);
when(moduleApi.getUtlatandeFromJson(anyString())).thenReturn(utlatande);
setTypedField(intygSignatureService, new SignaturTicketTracker());
pagaendeSignering = mock(PagaendeSignering.class);
when(pagaendeSignering.getInternReferens()).thenReturn(PAGAENDE_SIGN_ID);
when(pagaendeSignering.getIntygData()).thenReturn(INTYG_JSON);
when(pagaendeSignering.getIntygsId()).thenReturn(INTYG_ID);
when(pagaendeSignering.getSigneradAvHsaId()).thenReturn(hoSPerson.getPersonId());
when(pagaendeSignering.getSigneradAvNamn()).thenReturn(hoSPerson.getFullstandigtNamn());
when(pagaendeSigneringRepository.findOne(any())).thenReturn(pagaendeSignering);
when(pagaendeSigneringRepository.save(any(PagaendeSignering.class))).thenReturn(pagaendeSignering);
}
use of se.inera.intyg.infra.integration.hsa.model.Vardgivare in project webcert by sklintyg.
the class FragaSvarServiceImplTest method buildUserOfRole.
private WebCertUser buildUserOfRole(Role role) {
WebCertUser user = new WebCertUser();
user.setRoles(AuthoritiesResolverUtil.toMap(role));
user.setAuthorities(AuthoritiesResolverUtil.toMap(role.getPrivileges(), Privilege::getName));
user.setOrigin("NORMAL");
user.setHsaId("testuser");
user.setNamn("test userman");
Feature feature = new Feature();
feature.setName(AuthoritiesConstants.FEATURE_HANTERA_FRAGOR);
feature.setGlobal(true);
feature.setIntygstyper(ImmutableList.of("fk7263"));
user.setFeatures(ImmutableMap.of(AuthoritiesConstants.FEATURE_HANTERA_FRAGOR, feature));
Vardenhet vardenhet = new Vardenhet("enhet", "Enhet");
Vardgivare vardgivare = new Vardgivare("vardgivare", "Vardgivaren");
vardgivare.getVardenheter().add(vardenhet);
user.setVardgivare(Collections.singletonList(vardgivare));
user.setValdVardenhet(vardenhet);
return user;
}
Aggregations