Search in sources :

Example 16 with InsuranceService

use of com.salaboy.jbpm5.dev.guide.webservice.InsuranceService in project jBPM5-Developer-Guide by Salaboy.

the class GetPatientDataCommand method execute.

public ExecutionResults execute(CommandContext ctx) throws MalformedURLException {
    String patientId = (String) ctx.getData("gatherdata_patientName");
    InsuranceService client = getClient();
    Patient patientData = client.getPatientData(patientId);
    ExecutionResults executionResults = new ExecutionResults();
    executionResults.setData("gatherdata_patient", patientData);
    return executionResults;
}
Also used : InsuranceService(com.salaboy.jbpm5.dev.guide.webservice.InsuranceService) ExecutionResults(org.jbpm.executor.api.ExecutionResults) Patient(com.salaboy.jbpm5.dev.guide.model.Patient)

Example 17 with InsuranceService

use of com.salaboy.jbpm5.dev.guide.webservice.InsuranceService in project jBPM5-Developer-Guide by Salaboy.

the class NotifyAndChargePatientCommand method getClient.

private InsuranceService getClient() throws MalformedURLException {
    URL wsdlURL = new URL("http://127.0.0.1:19999/InsuranceServiceImpl/insurance?WSDL");
    QName SERVICE_QNAME = new QName("http://webservice.guide.dev.jbpm5.salaboy.com/", "InsuranceServiceImplService");
    Service service = Service.create(wsdlURL, SERVICE_QNAME);
    InsuranceService client = service.getPort(InsuranceService.class);
    return client;
}
Also used : InsuranceService(com.salaboy.jbpm5.dev.guide.webservice.InsuranceService) QName(javax.xml.namespace.QName) InsuranceService(com.salaboy.jbpm5.dev.guide.webservice.InsuranceService) Service(javax.xml.ws.Service) URL(java.net.URL)

Example 18 with InsuranceService

use of com.salaboy.jbpm5.dev.guide.webservice.InsuranceService in project jBPM5-Developer-Guide by Salaboy.

the class NotifyAndChargePatientCommand method execute.

public ExecutionResults execute(CommandContext ctx) {
    Patient patient = (Patient) ctx.getData("invoice_patient");
    BigDecimal finalAmount = (BigDecimal) ctx.getData("invoice_finalAmount");
    List<ConceptCode> concepts = (List<ConceptCode>) ctx.getData("invoice_concepts");
    boolean patientNotified = false;
    try {
        InsuranceService client = getClient();
        patientNotified = client.notifyAndChargePatient(patient, finalAmount, concepts);
    } catch (MalformedURLException ex) {
        ex.printStackTrace();
    }
    System.out.println(" >>> Patient Notified = " + patientNotified);
    ExecutionResults results = new ExecutionResults();
    results.setData("invoice_patientNotified", patientNotified);
    return results;
}
Also used : ConceptCode(com.salaboy.jbpm5.dev.guide.model.ConceptCode) MalformedURLException(java.net.MalformedURLException) InsuranceService(com.salaboy.jbpm5.dev.guide.webservice.InsuranceService) ExecutionResults(org.jbpm.executor.api.ExecutionResults) Patient(com.salaboy.jbpm5.dev.guide.model.Patient) List(java.util.List) BigDecimal(java.math.BigDecimal)

Example 19 with InsuranceService

use of com.salaboy.jbpm5.dev.guide.webservice.InsuranceService in project jBPM5-Developer-Guide by Salaboy.

the class IsPatientInsuredCommand method getClient.

private InsuranceService getClient() throws MalformedURLException {
    URL wsdlURL = new URL("http://127.0.0.1:19999/InsuranceServiceImpl/insurance?WSDL");
    QName SERVICE_QNAME = new QName("http://webservice.guide.dev.jbpm5.salaboy.com/", "InsuranceServiceImplService");
    Service service = Service.create(wsdlURL, SERVICE_QNAME);
    InsuranceService client = service.getPort(InsuranceService.class);
    return client;
}
Also used : InsuranceService(com.salaboy.jbpm5.dev.guide.webservice.InsuranceService) QName(javax.xml.namespace.QName) InsuranceService(com.salaboy.jbpm5.dev.guide.webservice.InsuranceService) Service(javax.xml.ws.Service) URL(java.net.URL)

Example 20 with InsuranceService

use of com.salaboy.jbpm5.dev.guide.webservice.InsuranceService in project jBPM5-Developer-Guide by Salaboy.

the class NotifyInsuranceCompanyCommand method getClient.

private InsuranceService getClient() throws MalformedURLException {
    URL wsdlURL = new URL("http://127.0.0.1:19999/InsuranceServiceImpl/insurance?WSDL");
    QName SERVICE_QNAME = new QName("http://webservice.guide.dev.jbpm5.salaboy.com/", "InsuranceServiceImplService");
    Service service = Service.create(wsdlURL, SERVICE_QNAME);
    InsuranceService client = service.getPort(InsuranceService.class);
    return client;
}
Also used : InsuranceService(com.salaboy.jbpm5.dev.guide.webservice.InsuranceService) QName(javax.xml.namespace.QName) InsuranceService(com.salaboy.jbpm5.dev.guide.webservice.InsuranceService) Service(javax.xml.ws.Service) URL(java.net.URL)

Aggregations

InsuranceService (com.salaboy.jbpm5.dev.guide.webservice.InsuranceService)20 URL (java.net.URL)10 QName (javax.xml.namespace.QName)10 Service (javax.xml.ws.Service)10 MalformedURLException (java.net.MalformedURLException)9 ConceptCode (com.salaboy.jbpm5.dev.guide.model.ConceptCode)6 BigDecimal (java.math.BigDecimal)6 HashMap (java.util.HashMap)5 ExecutionResults (org.jbpm.executor.api.ExecutionResults)5 Patient (com.salaboy.jbpm5.dev.guide.model.Patient)4 ArrayList (java.util.ArrayList)4 List (java.util.List)2 PatientDataServiceWorkItemHandler (com.salaboy.jbpm5.dev.guide.workitems.PatientDataServiceWorkItemHandler)1