use of se.riv.infrastructure.directory.privatepractitioner.getprivatepractitionerresponder.v1.GetPrivatePractitionerType in project webcert by sklintyg.
the class GetPrivatePractitionerResponderTest method noPersonIdThrowsException.
@Test(expected = IllegalArgumentException.class)
public void noPersonIdThrowsException() {
GetPrivatePractitionerType request = new GetPrivatePractitionerType();
ws.getPrivatePractitioner(null, request);
}
use of se.riv.infrastructure.directory.privatepractitioner.getprivatepractitionerresponder.v1.GetPrivatePractitionerType in project webcert by sklintyg.
the class GetPrivatePractitionerResponderTest method defaultRequest.
private GetPrivatePractitionerType defaultRequest() {
GetPrivatePractitionerType request = new GetPrivatePractitionerType();
request.setPersonalIdentityNumber(PERSONNUMMER);
return request;
}
use of se.riv.infrastructure.directory.privatepractitioner.getprivatepractitionerresponder.v1.GetPrivatePractitionerType in project webcert by sklintyg.
the class PPServiceImpl method createPrivatePractitionerType.
private GetPrivatePractitionerType createPrivatePractitionerType(String hsaIdentityNumber, String personalIdentityNumber) {
GetPrivatePractitionerType ppType = new GetPrivatePractitionerType();
ppType.setPersonHsaId(hsaIdentityNumber);
ppType.setPersonalIdentityNumber(personalIdentityNumber);
return ppType;
}
use of se.riv.infrastructure.directory.privatepractitioner.getprivatepractitionerresponder.v1.GetPrivatePractitionerType in project webcert by sklintyg.
the class GetPrivatePractitionerResponderStub method getGetPrivatePractitionerResponseTypeForPnr.
private GetPrivatePractitionerResponseType getGetPrivatePractitionerResponseTypeForPnr(GetPrivatePractitionerType parameters) {
String id = parameters.getPersonalIdentityNumber();
Personnummer personnummer = Personnummer.createPersonnummer(id).orElse(null);
GetPrivatePractitionerResponseType response = new GetPrivatePractitionerResponseType();
// if matching -- create error response
if (PERSONNUMMER_ERROR_RESPONSE.equals(id)) {
response.setHoSPerson(null);
response.setResultCode(ResultCodeEnum.ERROR);
response.setResultText("FAILURE: an error occured while trying to get private practitioner with personal identity number: " + Personnummer.getPersonnummerHashSafe(personnummer) + " exists.");
return response;
}
// if matching -- throw exception
if (PERSONNUMMER_THROW_EXCEPTION.equals(id)) {
throw new SOAPFaultException(createSOAPFault());
}
HoSPersonType person = personStub.get(id);
if (person == null) {
response.setResultCode(ResultCodeEnum.INFO);
response.setResultText("No private practitioner with personal identity number: " + Personnummer.getPersonnummerHashSafe(personnummer) + " exists.");
} else {
response.setHoSPerson(person);
response.setResultCode(ResultCodeEnum.OK);
}
return response;
}
use of se.riv.infrastructure.directory.privatepractitioner.getprivatepractitionerresponder.v1.GetPrivatePractitionerType in project webcert by sklintyg.
the class GetPrivatePractitionerResponderStub method getGetPrivatePractitionerResponseTypeForHsaid.
private GetPrivatePractitionerResponseType getGetPrivatePractitionerResponseTypeForHsaid(GetPrivatePractitionerType parameters) {
String hsa = parameters.getPersonHsaId();
GetPrivatePractitionerResponseType response = new GetPrivatePractitionerResponseType();
// if matching -- create error response
if (PERSONNUMMER_ERROR_RESPONSE.equals(hsa)) {
response.setHoSPerson(null);
response.setResultCode(ResultCodeEnum.ERROR);
response.setResultText("FAILURE: an error occured while trying to get private practitioner with hsa id: " + hsa + " exists.");
return response;
}
// if matching -- throw exception
if (PERSONNUMMER_THROW_EXCEPTION.equals(hsa)) {
throw new SOAPFaultException(createSOAPFault());
}
HoSPersonType person = personStub.getByHsaId(hsa);
if (person == null) {
response.setResultCode(ResultCodeEnum.INFO);
response.setResultText("No private practitioner with hsa id: " + hsa + " exists.");
} else {
response.setHoSPerson(person);
response.setResultCode(ResultCodeEnum.OK);
}
return response;
}
Aggregations