use of com.salaboy.jbpm5.dev.guide.webservice.InsuranceService in project jBPM5-Developer-Guide by Salaboy.
the class PatientDataServiceWorkItemHandler method executeWorkItem.
public void executeWorkItem(WorkItem wi, WorkItemManager wim) {
String patientId = (String) wi.getParameter("gatherdata_patientName");
Patient patientData = null;
InsuranceService client = getClient();
patientData = client.getPatientData(patientId);
Map<String, Object> result = new HashMap<String, Object>();
result.put("gatherdata_patient", patientData);
wim.completeWorkItem(wi.getId(), result);
}
use of com.salaboy.jbpm5.dev.guide.webservice.InsuranceService in project jBPM5-Developer-Guide by Salaboy.
the class CompanyGatewayWorkItemHandler method executeWorkItem.
public void executeWorkItem(WorkItem wi, WorkItemManager wim) {
String patientId = (String) wi.getParameter("company_patientName");
BigDecimal finalAmount = BigDecimal.ZERO;
InsuranceService client = getClient();
// Fixed rate for insured patients
finalAmount = client.notifyInsuranceCompany("Company 1", patientId, new BigDecimal(100));
Map<String, Object> result = new HashMap<String, Object>();
result.put("company_finalAmount", finalAmount);
List<ConceptCode> concepts = new ArrayList<ConceptCode>(1);
concepts.add(new ConceptCode("CO-9999", finalAmount, " Insured Flat Rate", 1));
result.put("company_concepts", concepts);
wim.completeWorkItem(wi.getId(), result);
}
use of com.salaboy.jbpm5.dev.guide.webservice.InsuranceService in project jBPM5-Developer-Guide by Salaboy.
the class InvoiceServiceWorkItemHandler method executeWorkItem.
public void executeWorkItem(WorkItem wi, WorkItemManager wim) {
Patient patient = (Patient) wi.getParameter("invoice_patient");
BigDecimal finalAmount = (BigDecimal) wi.getParameter("invoice_finalAmount");
List<ConceptCode> concepts = (List<ConceptCode>) wi.getParameter("invoice_concepts");
boolean patientNotified = false;
InsuranceService client = getClient();
patientNotified = client.notifyAndChargePatient(patient, finalAmount, concepts);
System.out.println(" >>> Patient Notified = " + patientNotified);
Map<String, Object> result = new HashMap<String, Object>();
result.put("invoice_patientNotified", patientNotified);
wim.completeWorkItem(wi.getId(), result);
}
use of com.salaboy.jbpm5.dev.guide.webservice.InsuranceService in project jBPM5-Developer-Guide by Salaboy.
the class InvoiceServiceWorkItemHandler method getClient.
private InsuranceService getClient() {
InsuranceService client = null;
try {
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);
client = service.getPort(InsuranceService.class);
} catch (MalformedURLException ex) {
Logger.getLogger(CompanyGatewayWorkItemHandler.class.getName()).log(Level.SEVERE, null, ex);
}
return client;
}
use of com.salaboy.jbpm5.dev.guide.webservice.InsuranceService in project jBPM5-Developer-Guide by Salaboy.
the class CalculateHospitalRatesCommand method execute.
public ExecutionResults execute(CommandContext ctx) {
String patientId = (String) ctx.getData("rates_patientName");
BigDecimal finalAmount = BigDecimal.ZERO;
// Mock Data
List<ConceptCode> concepts = new ArrayList<ConceptCode>(2);
concepts.add(new ConceptCode("CO-123", new BigDecimal(125), "Dialy Hospital Bed Rate", 4));
concepts.add(new ConceptCode("CO-123", new BigDecimal(100), "Nurse Service", 1));
try {
InsuranceService client = getClient();
// Fixed rate for insured patients
finalAmount = client.calculateHospitalRates(patientId, concepts);
} catch (MalformedURLException ex) {
Logger.getLogger(PatientDataServiceWorkItemHandler.class.getName()).log(Level.SEVERE, null, ex);
}
ExecutionResults results = new ExecutionResults();
results.setData("rates_finalAmount", finalAmount);
results.setData("rates_concepts", concepts);
return results;
}
Aggregations