Package se.inera.ifv.receivemedicalcertificatequestionsponder.v1

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


        logicalAddressHeader.setValue(logicalAddresss);

        ReceiveMedicalCertificateQuestionType request = new ReceiveMedicalCertificateQuestionType();

        // Simple Question
        QuestionFromFkType meddelande = new QuestionFromFkType();
        request.setQuestion(meddelande);
        meddelande.setAmne(Amnetyp.KONTAKT);
        InnehallType fraga = new InnehallType();
        fraga.setMeddelandeText("Kontakta mig!");
        meddelande.setFraga(fraga);

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

            if (result != null) {
View Full Code Here


            response.getResult().setResultCode(ResultCodeEnum.OK);
            response.setQuestionsLeft(questionValue.getQuestionsLeft());
            response.setQuestions(new QuestionsType());

            for (Question q : questionValue.getQuestions()) {
                QuestionFromFkType questionFromFk = (QuestionFromFkType) q.getMessage();
                QuestionType qt = new QuestionType();
                qt.setId(q.getId().toString());
                qt.setReceivedDate(q.getArrived());
                qt.setQuestion(questionFromFk);
View Full Code Here

                .getReceiveMedicalCertificateQuestionResponderPort();

        ReceiveMedicalCertificateQuestionType request = new ReceiveMedicalCertificateQuestionType();

        // Simple Question
        QuestionFromFkType meddelande = new QuestionFromFkType();
        request.setQuestion(meddelande);
        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) {
View Full Code Here

        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

        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

        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

        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

    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

                .getReceiveMedicalCertificateQuestionResponderPort();

        AttributedURIType logicalAddressHeader = new AttributedURIType();
        logicalAddressHeader.setValue(logicalAddresss);

        ReceiveMedicalCertificateQuestionType request = new ReceiveMedicalCertificateQuestionType();

        // Simple Question
        QuestionFromFkType meddelande = new QuestionFromFkType();
        request.setQuestion(meddelande);
        meddelande.setAmne(Amnetyp.KONTAKT);
        InnehallType fraga = new InnehallType();
        fraga.setMeddelandeText("Kontakta mig!");
        meddelande.setFraga(fraga);
View Full Code Here

       
        ReceiveMedicalCertificateQuestionResponderInterface service = new ReceiveMedicalCertificateQuestionResponderService(
                createEndpointUrlFromServiceAddress(SERVICE_ADDRESS))
                .getReceiveMedicalCertificateQuestionResponderPort();

        ReceiveMedicalCertificateQuestionType request = new ReceiveMedicalCertificateQuestionType();

        // Simple Question
        QuestionFromFkType meddelande = new QuestionFromFkType();
        request.setQuestion(meddelande);
        meddelande.setAmne(Amnetyp.KONTAKT);
        InnehallType fraga = new InnehallType();
        fraga.setMeddelandeText("Kontakta mig!");
        meddelande.setFraga(fraga);
View Full Code Here

TOP

Related Classes of se.inera.ifv.receivemedicalcertificatequestionsponder.v1.QuestionFromFkType

Copyright © 2018 www.massapicom. 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.