use of se.riv.clinicalprocess.healthcond.certificate.v3.ResultType in project ddf by codice.
the class CswQueryResponseTransformer method buildCollection.
private CswRecordCollection buildCollection(SourceResponse sourceResponse, Map<String, Serializable> arguments) {
CswRecordCollection recordCollection = new CswRecordCollection();
recordCollection.setNumberOfRecordsMatched(sourceResponse.getHits());
recordCollection.setNumberOfRecordsReturned(sourceResponse.getResults().size());
recordCollection.setStartPosition(sourceResponse.getRequest().getQuery().getStartIndex());
Object elementSetTypeArg = arguments.get(CswConstants.ELEMENT_SET_TYPE);
if (elementSetTypeArg instanceof ElementSetType) {
ElementSetType elementSetType = (ElementSetType) elementSetTypeArg;
recordCollection.setElementSetType(elementSetType);
}
Object elementNamesArg = arguments.get(CswConstants.ELEMENT_NAMES);
if (elementNamesArg instanceof QName[]) {
QName[] qnames = (QName[]) elementNamesArg;
if (qnames.length > 0) {
List<QName> elementNames = new ArrayList();
for (QName entry : qnames) {
elementNames.add(entry);
}
recordCollection.setElementName(elementNames);
}
}
Object isByIdQuery = arguments.get(CswConstants.IS_BY_ID_QUERY);
if (isByIdQuery != null) {
recordCollection.setById((Boolean) isByIdQuery);
}
Object arg = arguments.get((CswConstants.GET_RECORDS));
if (arg != null && arg instanceof GetRecordsType) {
recordCollection.setRequest((GetRecordsType) arg);
}
Object resultType = arguments.get(CswConstants.RESULT_TYPE_PARAMETER);
if (resultType instanceof ResultType) {
recordCollection.setResultType((ResultType) resultType);
}
Object outputSchema = arguments.get(CswConstants.OUTPUT_SCHEMA_PARAMETER);
if (outputSchema instanceof String) {
recordCollection.setOutputSchema((String) outputSchema);
} else {
recordCollection.setOutputSchema(CswConstants.CSW_OUTPUT_SCHEMA);
}
Object doWriteNamespaces = arguments.get(CswConstants.WRITE_NAMESPACES);
if (doWriteNamespaces instanceof Boolean) {
recordCollection.setDoWriteNamespaces((Boolean) doWriteNamespaces);
}
return recordCollection;
}
use of se.riv.clinicalprocess.healthcond.certificate.v3.ResultType in project webcert by sklintyg.
the class SendCertificateToRecipientResponderStub method sendCertificateToRecipient.
@Override
@StubLatencyAware
@StubModeAware
public SendCertificateToRecipientResponseType sendCertificateToRecipient(String logicalAddress, SendCertificateToRecipientType parameters) {
CertificateHolder fromStore = intygStore.getIntygForCertificateId(parameters.getIntygsId().getExtension());
SendCertificateToRecipientResponseType responseType = new SendCertificateToRecipientResponseType();
if (fromStore == null) {
ResultType resultOfCall = new ResultType();
resultOfCall.setResultCode(ResultCodeType.ERROR);
resultOfCall.setErrorId(ErrorIdType.APPLICATION_ERROR);
responseType.setResult(resultOfCall);
return responseType;
}
intygStore.addStatus(parameters.getIntygsId().getExtension(), new CertificateStateHolder("FKASSA", CertificateState.SENT, LocalDateTime.now()));
ResultType resultType = new ResultType();
resultType.setResultCode(ResultCodeType.OK);
responseType.setResult(resultType);
return responseType;
}
use of se.riv.clinicalprocess.healthcond.certificate.v3.ResultType in project webcert by sklintyg.
the class SendCertificateServiceClientTest method buildResultOfCall.
private ResultType buildResultOfCall(ResultCodeType resultCodeType) {
ResultType roc = new ResultType();
roc.setResultCode(resultCodeType);
return roc;
}
use of se.riv.clinicalprocess.healthcond.certificate.v3.ResultType in project webcert by sklintyg.
the class CertificateStatusUpdateForCareResponderStub method certificateStatusUpdateForCare.
@Override
public CertificateStatusUpdateForCareResponseType certificateStatusUpdateForCare(String logicalAddress, CertificateStatusUpdateForCareType request) {
counter.incrementAndGet();
String utlatandeId = getUtlatandeId(request);
LOG.debug("utlatandeId: " + utlatandeId);
LOG.debug("numberOfReceivedMessages: " + getNumberOfReceivedMessages());
if (utlatandeId.startsWith(FALLERAT_MEDDELANDE)) {
int attempts = increaseAttempts(utlatandeId);
int numberOfRequestedFailedAttempts = Integer.parseInt(utlatandeId.substring(utlatandeId.length() - 1));
LOG.debug("attempts: " + attempts);
LOG.debug("numberOfRequestedFailedAttempts: " + numberOfRequestedFailedAttempts);
if (attempts < numberOfRequestedFailedAttempts + 1) {
throw new RuntimeException("Something went wrong");
}
}
store.add(request);
CertificateStatusUpdateForCareResponseType response = new CertificateStatusUpdateForCareResponseType();
ResultType result = new ResultType();
result.setResultCode(ResultCodeType.OK);
response.setResult(result);
LOG.debug("Request set to 'OK'");
return response;
}
use of se.riv.clinicalprocess.healthcond.certificate.v3.ResultType in project webcert by sklintyg.
the class NotificationWSClientTest method buildResponse.
private CertificateStatusUpdateForCareResponseType buildResponse(ResultCodeType code, ErrorIdType errorId, String resultText) {
CertificateStatusUpdateForCareResponseType res = new CertificateStatusUpdateForCareResponseType();
res.setResult(new ResultType());
res.getResult().setResultCode(code);
res.getResult().setErrorId(errorId);
res.getResult().setResultText(resultText);
return res;
}
Aggregations