Examples of ReceiveMedicalCertificateQuestionResponseType


Examples of se.inera.ifv.receivemedicalcertificatequestionsponder.v1.ReceiveMedicalCertificateQuestionResponseType

        InnehallType fraga = new InnehallType();
        fraga.setMeddelandeText("Kontakta mig!");
        meddelande.setFraga(fraga);

        try {
            ReceiveMedicalCertificateQuestionResponseType result = service.receiveMedicalCertificateQuestion(logicalAddressHeader, request);

            if (result != null) {
                return ("Result OK");
            } else {
                return ("Result Error!");
View Full Code Here

Examples of se.inera.ifv.receivemedicalcertificatequestionsponder.v1.ReceiveMedicalCertificateQuestionResponseType

        meddelande.setAmne(Amnetyp.KONTAKT);
        InnehallType fraga = new InnehallType();
        fraga.setMeddelandeText("Kontakta mig!");
        meddelande.setFraga(fraga);

        ReceiveMedicalCertificateQuestionResponseType result = null;
        try {
            result = service.receiveMedicalCertificateQuestion(logicalAddress, request);
        } catch (Exception ex) {
            System.out.println("Exception=" + ex.getMessage());
        }
View Full Code Here

Examples of se.inera.ifv.receivemedicalcertificatequestionsponder.v1.ReceiveMedicalCertificateQuestionResponseType

        JAXBElement<ReceiveMedicalCertificateQuestionType> t = (JAXBElement<ReceiveMedicalCertificateQuestionType>) unmarshaller
                .unmarshal(is);
        AttributedURIType logicalAddress = new AttributedURIType();
        logicalAddress.setValue("careUnit1");

        ReceiveMedicalCertificateQuestionResponseType response = impl.receiveMedicalCertificateQuestion(logicalAddress,
                t.getValue());

        assertEquals("careUnit1", question.getValue().getCareUnit());
        assertNotNull(question.getValue().getArrived());
        assertNull(question.getValue().getId());
        assertEquals(ResultCodeEnum.OK, response.getResult().getResultCode());
    }
View Full Code Here

Examples of se.inera.ifv.receivemedicalcertificatequestionsponder.v1.ReceiveMedicalCertificateQuestionResponseType

        JAXBElement<ReceiveMedicalCertificateQuestionType> t = (JAXBElement<ReceiveMedicalCertificateQuestionType>) unmarshaller
                .unmarshal(is);
        AttributedURIType logicalAddress = new AttributedURIType();
        logicalAddress.setValue("careUnit1");

        ReceiveMedicalCertificateQuestionResponseType response = impl.receiveMedicalCertificateQuestion(logicalAddress,
                t.getValue());

        assertEquals(ResultCodeEnum.ERROR, response.getResult().getResultCode());
        assertEquals(ErrorIdEnum.APPLICATION_ERROR, response.getResult().getErrorId());
        assertEquals("Some message", response.getResult().getErrorText());

    }
View Full Code Here

Examples of se.inera.ifv.receivemedicalcertificatequestionsponder.v1.ReceiveMedicalCertificateQuestionResponseType

    public ReceiveMedicalCertificateQuestionResponseType receiveMedicalCertificateQuestion(
            AttributedURIType logicalAddress, ReceiveMedicalCertificateQuestionType parameters) {

        // TODO: Should we have a default error response here?
        ReceiveMedicalCertificateQuestionResponseType response = null;

        try {
      // The adress consist of an address in the format XX#caregiver#careunit or caregiver#careunit or only careunit
      String careGiverAndCareUnit = logicalAddress.getValue();
      String careUnit = "";
      if (careGiverAndCareUnit.indexOf("#") < 0) {
        careUnit = careGiverAndCareUnit;
      } else {
        careUnit = careGiverAndCareUnit.substring(careGiverAndCareUnit.lastIndexOf("#")+1, careGiverAndCareUnit.length());
      }

            log.debug("Received MedicalCertificateQuestion for care unit={}", careUnit);

            Question question = new Question(careUnit, parameters.getQuestion());

            questionService.saveQuestion(question);

            response = new ReceiveMedicalCertificateQuestionResponseType();
            response.setResult(new ResultOfCall());
            response.getResult().setResultCode(ResultCodeEnum.OK);
           
        } catch (Exception e) {
            log.warn("Error handling MedicalCertificateQuestion" ,e);
            // TODO: Fix this error handling
            response = new ReceiveMedicalCertificateQuestionResponseType();
            response.setResult(new ResultOfCall());
            response.getResult().setResultCode(ResultCodeEnum.ERROR);
            response.getResult().setErrorId(ErrorIdEnum.APPLICATION_ERROR);
            response.getResult().setErrorText(e.getMessage());
        }

        return response;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.