use of com.salaboy.jbpm5.dev.guide.model.Patient in project jBPM5-Developer-Guide by Salaboy.
the class HospitalInsuranceProcessTest method setUp.
@Before
public void setUp() {
initializeWebService();
initializeSession();
Patient salaboy = new Patient(UUID.randomUUID().toString(), "Salaboy", "SalaboyLastName", "salaboy@gmail.com", "555-15151-515151", 28);
testPatients.put("salaboy", salaboy);
Patient nonInsuredBrotha = new Patient(UUID.randomUUID().toString(), "John", "Doe", "gangsta1980@gmail.com", "333-333131-13131", 40);
testPatients.put("brotha", nonInsuredBrotha);
this.service.getPatients().put(testPatients.get("salaboy").getId(), testPatients.get("salaboy"));
this.service.getPatients().put(testPatients.get("brotha").getId(), testPatients.get("brotha"));
this.service.getInsuredPatients().put(testPatients.get("salaboy").getId(), Boolean.TRUE);
this.service.getInsuredPatients().put(testPatients.get("brotha").getId(), Boolean.FALSE);
}
use of com.salaboy.jbpm5.dev.guide.model.Patient in project jBPM5-Developer-Guide by Salaboy.
the class HospitalInsuranceProcessTest method testPatientNotInsuredProcess.
/**
* Tests the execution path for a patient NOT having a valid insurance.
*/
@Test
public void testPatientNotInsuredProcess() {
HashMap<String, Object> input = new HashMap<String, Object>();
Patient brotha = testPatients.get("brotha");
input.put("patientName", brotha.getId());
WorkflowProcessInstance pI = (WorkflowProcessInstance) session.startProcess("NewPatientInsuranceCheck", input);
assertEquals(ProcessInstance.STATE_COMPLETED, pI.getState());
assertEquals(Boolean.TRUE, pI.getVariable("patientNotified"));
assertEquals(600, ((BigDecimal) pI.getVariable("finalAmount")).intValue());
}
use of com.salaboy.jbpm5.dev.guide.model.Patient in project jBPM5-Developer-Guide by Salaboy.
the class HospitalInsuranceServiceTest method patientInsuredTest.
@Test
public void patientInsuredTest() {
Patient patient = this.service.getPatientData(testPatients.get("salaboy").getId());
assertNotNull(patient);
boolean isPatientInsured = this.service.isPatientInsured(patient.getId());
assertTrue(isPatientInsured);
BigDecimal insuredAmount = this.service.notifyInsuranceCompany("Insurance Company 1", patient.getId(), new BigDecimal(100));
assertEquals(50, insuredAmount.intValue());
List<ConceptCode> concepts = new ArrayList<ConceptCode>(1);
concepts.add(new ConceptCode("CO-9999", insuredAmount, "Insured Patient Flat Rate", 1));
boolean notifyAndChargePatient = this.service.notifyAndChargePatient(patient, insuredAmount, concepts);
assertTrue(notifyAndChargePatient);
}
use of com.salaboy.jbpm5.dev.guide.model.Patient in project jBPM5-Developer-Guide by Salaboy.
the class ServiceTaskTest method setUp.
@Before
public void setUp() {
initializeSession();
Patient salaboy = new Patient(UUID.randomUUID().toString(), "Salaboy", "SalaboyLastName", "salaboy@gmail.com", "555-15151-515151", 28);
testPatients.put("salaboy", salaboy);
Patient nonInsuredBrotha = new Patient(UUID.randomUUID().toString(), "John", "Doe", "gangsta1980@gmail.com", "333-333131-13131", 40);
testPatients.put("brotha", nonInsuredBrotha);
SimpleValidationServiceImpl.insuredPatients.put(testPatients.get("salaboy").getId(), Boolean.TRUE);
SimpleValidationServiceImpl.insuredPatients.put(testPatients.get("brotha").getId(), Boolean.FALSE);
}
use of com.salaboy.jbpm5.dev.guide.model.Patient in project jBPM5-Developer-Guide by Salaboy.
the class HospitalInsuranceProcessExecutorTest method setUp.
@Before
public void setUp() {
initializeWebService();
Patient salaboy = new Patient(UUID.randomUUID().toString(), "Salaboy", "SalaboyLastName", "salaboy@gmail.com", "555-15151-515151", 28);
testPatients.put("salaboy", salaboy);
Patient nonInsuredBrotha = new Patient(UUID.randomUUID().toString(), "John", "Doe", "gangsta1980@gmail.com", "333-333131-13131", 40);
testPatients.put("brotha", nonInsuredBrotha);
this.service.getPatients().put(testPatients.get("salaboy").getId(), testPatients.get("salaboy"));
this.service.getPatients().put(testPatients.get("brotha").getId(), testPatients.get("brotha"));
this.service.getInsuredPatients().put(testPatients.get("salaboy").getId(), Boolean.TRUE);
this.service.getInsuredPatients().put(testPatients.get("brotha").getId(), Boolean.FALSE);
System.out.println(" >>> Insured Patients: " + this.service.getInsuredPatients());
executor = ExecutorModule.getInstance().getExecutorServiceEntryPoint();
executor.setThreadPoolSize(1);
executor.setInterval(3);
executor.init();
initializeSession();
}
Aggregations