Search in sources :

Example 16 with Patient

use of com.salaboy.jbpm5.dev.guide.model.Patient 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 Patient

use of com.salaboy.jbpm5.dev.guide.model.Patient 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)

Aggregations

Patient (com.salaboy.jbpm5.dev.guide.model.Patient)15 HashMap (java.util.HashMap)6 Test (org.junit.Test)6 ConceptCode (com.salaboy.jbpm5.dev.guide.model.ConceptCode)5 InsuranceService (com.salaboy.jbpm5.dev.guide.webservice.InsuranceService)4 BigDecimal (java.math.BigDecimal)4 WorkflowProcessInstance (org.drools.runtime.process.WorkflowProcessInstance)4 Before (org.junit.Before)4 ArrayList (java.util.ArrayList)2 List (java.util.List)2 ExecutionResults (org.jbpm.executor.api.ExecutionResults)2 SimpleValidationServiceImpl (com.salaboy.jbpm5.dev.guide.webservice.SimpleValidationServiceImpl)1 AsyncGenericWorkItemHandler (com.salaboy.jbpm5.dev.guide.workitems.AsyncGenericWorkItemHandler)1 MalformedURLException (java.net.MalformedURLException)1 DateFormat (java.text.DateFormat)1 SimpleDateFormat (java.text.SimpleDateFormat)1 Date (java.util.Date)1 KnowledgeBase (org.drools.KnowledgeBase)1 KnowledgeBuilder (org.drools.builder.KnowledgeBuilder)1 KnowledgeBuilderError (org.drools.builder.KnowledgeBuilderError)1