Search in sources :

Example 6 with IntygsReferens

use of se.inera.intyg.webcert.persistence.fragasvar.model.IntygsReferens in project webcert by sklintyg.

the class FragaSvarModuleApiControllerTest method buildFragaSvarViewList.

private List<FragaSvarView> buildFragaSvarViewList() {
    List<FragaSvarView> fragaSvarViewList = new ArrayList<>();
    IntygsReferens intygsReferens = mock(IntygsReferens.class);
    FragaSvar fs = mock(FragaSvar.class);
    FragaSvarView fsw = mock(FragaSvarView.class);
    fragaSvarViewList.add(fsw);
    return fragaSvarViewList;
}
Also used : IntygsReferens(se.inera.intyg.webcert.persistence.fragasvar.model.IntygsReferens) ArrayList(java.util.ArrayList) FragaSvar(se.inera.intyg.webcert.persistence.fragasvar.model.FragaSvar) FragaSvarView(se.inera.intyg.webcert.web.web.controller.api.dto.FragaSvarView)

Example 7 with IntygsReferens

use of se.inera.intyg.webcert.persistence.fragasvar.model.IntygsReferens in project webcert by sklintyg.

the class FragaSvarRepositoryTest method testFindByIntygsReferens.

@Test
public void testFindByIntygsReferens() {
    FragaSvar saved = buildFragaSvarFraga(ENHET_1_ID);
    saved.setIntygsReferens(new IntygsReferens("non-existing-intygs-id", "fk", Personnummer.createPersonnummer("19121212-1212").get(), "Sven Persson", FRAGA_SENT_DATE));
    fragasvarRepository.save(saved);
    fragasvarRepository.save(buildFragaSvarFraga(ENHET_3_ID));
    fragasvarRepository.save(buildFragaSvarFraga(ENHET_4_ID));
    List<FragaSvar> result = fragasvarRepository.findByIntygsReferensIntygsId(INTYGS_REFERENS.getIntygsId());
    assertEquals(2, result.size());
}
Also used : IntygsReferens(se.inera.intyg.webcert.persistence.fragasvar.model.IntygsReferens) FragaSvar(se.inera.intyg.webcert.persistence.fragasvar.model.FragaSvar) Test(org.junit.Test)

Example 8 with IntygsReferens

use of se.inera.intyg.webcert.persistence.fragasvar.model.IntygsReferens in project webcert by sklintyg.

the class FragaSvarServiceImplTest method buildFraga.

private FragaSvar buildFraga(Long id, String frageText, Amne amne, LocalDateTime fragaSkickadDatum) {
    FragaSvar f = new FragaSvar();
    f.setStatus(Status.PENDING_INTERNAL_ACTION);
    f.setAmne(amne);
    f.setExternReferens("<fk-extern-referens>");
    f.setInternReferens(id);
    f.setFrageSkickadDatum(fragaSkickadDatum);
    f.setFrageText(frageText);
    f.setVardAktorHsaId("vardaktor-hsa-id");
    IntygsReferens intygsReferens = new IntygsReferens();
    intygsReferens.setIntygsId(INTYG_ID);
    intygsReferens.setIntygsTyp("fk7263");
    intygsReferens.setPatientId(PNR);
    f.setIntygsReferens(intygsReferens);
    f.setKompletteringar(new HashSet<>());
    f.setVardperson(new Vardperson());
    f.getVardperson().setEnhetsId("enhet");
    return f;
}
Also used : Vardperson(se.inera.intyg.webcert.persistence.fragasvar.model.Vardperson) IntygsReferens(se.inera.intyg.webcert.persistence.fragasvar.model.IntygsReferens) FragaSvar(se.inera.intyg.webcert.persistence.fragasvar.model.FragaSvar)

Example 9 with IntygsReferens

use of se.inera.intyg.webcert.persistence.fragasvar.model.IntygsReferens in project webcert by sklintyg.

the class FragaSvarServiceImplTest method buildFragaSvar.

private FragaSvar buildFragaSvar(Long id, LocalDateTime fragaSkickadDatum, LocalDateTime svarSkickadDatum) {
    FragaSvar f = new FragaSvar();
    f.setStatus(Status.PENDING_INTERNAL_ACTION);
    f.setAmne(Amne.OVRIGT);
    f.setExternReferens("<fk-extern-referens>");
    f.setInternReferens(id);
    f.setFrageSkickadDatum(fragaSkickadDatum);
    f.setFrageText("frageText");
    f.setSvarSkickadDatum(svarSkickadDatum);
    IntygsReferens intygsReferens = new IntygsReferens();
    intygsReferens.setIntygsId(INTYG_ID);
    intygsReferens.setIntygsTyp("fk7263");
    intygsReferens.setPatientId(PNR);
    f.setIntygsReferens(intygsReferens);
    f.setKompletteringar(new HashSet<>());
    f.setVardperson(new Vardperson());
    f.getVardperson().setEnhetsId("enhet");
    return f;
}
Also used : Vardperson(se.inera.intyg.webcert.persistence.fragasvar.model.Vardperson) IntygsReferens(se.inera.intyg.webcert.persistence.fragasvar.model.IntygsReferens) FragaSvar(se.inera.intyg.webcert.persistence.fragasvar.model.FragaSvar)

Example 10 with IntygsReferens

use of se.inera.intyg.webcert.persistence.fragasvar.model.IntygsReferens in project webcert by sklintyg.

the class ConvertToFKTypesTest method testToLakarUtlatandeSamordningsnummer.

@Test
public void testToLakarUtlatandeSamordningsnummer() {
    final String intygsId = "intygsId";
    final String patientNamn = "fullstÃĪndigt namn";
    final String patientId = "999999-9999";
    final LocalDateTime signeringsdatum = LocalDateTime.now();
    IntygsReferens ir = new IntygsReferens();
    ir.setIntygsId(intygsId);
    ir.setPatientNamn(patientNamn);
    ir.setPatientId(createPnr(patientId));
    ir.setSigneringsDatum(signeringsdatum);
    LakarutlatandeEnkelType res = ConvertToFKTypes.toLakarUtlatande(ir);
    assertNotNull(res);
    assertEquals(intygsId, res.getLakarutlatandeId());
    assertNull(res.getPatient().getFullstandigtNamn());
    assertEquals("1.2.752.129.2.1.3.3", res.getPatient().getPersonId().getRoot());
    assertEquals("19999999-9999", res.getPatient().getPersonId().getExtension());
    assertEquals(signeringsdatum, res.getSigneringsTidpunkt());
}
Also used : LocalDateTime(java.time.LocalDateTime) IntygsReferens(se.inera.intyg.webcert.persistence.fragasvar.model.IntygsReferens) LakarutlatandeEnkelType(se.inera.ifv.insuranceprocess.healthreporting.medcertqa.v1.LakarutlatandeEnkelType) Test(org.junit.Test)

Aggregations

IntygsReferens (se.inera.intyg.webcert.persistence.fragasvar.model.IntygsReferens)12 FragaSvar (se.inera.intyg.webcert.persistence.fragasvar.model.FragaSvar)10 Vardperson (se.inera.intyg.webcert.persistence.fragasvar.model.Vardperson)6 LocalDateTime (java.time.LocalDateTime)4 Test (org.junit.Test)4 LakarutlatandeEnkelType (se.inera.ifv.insuranceprocess.healthreporting.medcertqa.v1.LakarutlatandeEnkelType)2 JsonPath (com.jayway.restassured.path.json.JsonPath)1 Response (com.jayway.restassured.response.Response)1 ArrayList (java.util.ArrayList)1 SOAPFaultException (javax.xml.ws.soap.SOAPFaultException)1 AttributedURIType (org.w3.wsaddressing10.AttributedURIType)1 QuestionToFkType (se.inera.ifv.insuranceprocess.healthreporting.sendmedicalcertificatequestionresponder.v1.QuestionToFkType)1 SendMedicalCertificateQuestionResponseType (se.inera.ifv.insuranceprocess.healthreporting.sendmedicalcertificatequestionresponder.v1.SendMedicalCertificateQuestionResponseType)1 SendMedicalCertificateQuestionType (se.inera.ifv.insuranceprocess.healthreporting.sendmedicalcertificatequestionresponder.v1.SendMedicalCertificateQuestionType)1 HoSPersonal (se.inera.intyg.common.support.model.common.internal.HoSPersonal)1 WebCertServiceException (se.inera.intyg.webcert.common.service.exception.WebCertServiceException)1 Komplettering (se.inera.intyg.webcert.persistence.fragasvar.model.Komplettering)1 IntygContentHolder (se.inera.intyg.webcert.web.service.intyg.dto.IntygContentHolder)1 WebCertUser (se.inera.intyg.webcert.web.service.user.dto.WebCertUser)1 ArendeListItem (se.inera.intyg.webcert.web.web.controller.api.dto.ArendeListItem)1