Examples of Nurse


Examples of org.plugtree.training.model.Nurse

        final StatefulKnowledgeSession ksession = this.createKSession();
        WorkingMemoryEntryPoint bedEventsEP = ksession.getWorkingMemoryEntryPoint("bed-events");

        Patient patient = new Patient("John","Doe");

        Nurse nurse = new Nurse("Mary","Douglas");
        ksession.setGlobal("nurse", nurse);
        Doctor doctor = new Doctor("Gregory","House");
        ksession.setGlobal("doctor", doctor);

        assertTrue(nurse.getNotifications().isEmpty());

        //First event
        bedEventsEP.insert(new MonitorEvent(patient, MonitorEvent.Symptom.HIGH_TEMPERATURE));
        ksession.fireAllRules();

        assertTrue(nurse.getNotifications().isEmpty());

        //Second event: 5 minutes after
        clock.advanceTime(5, TimeUnit.MINUTES);
        bedEventsEP.insert(new MonitorEvent(patient, MonitorEvent.Symptom.HIGH_TEMPERATURE));
        ksession.fireAllRules();
       
        assertEquals(1,nurse.getNotifications().size());
        nurse.clearNotifications();

        //Third event: 15 minutes after the last one
        clock.advanceTime(15, TimeUnit.MINUTES);
        bedEventsEP.insert(new MonitorEvent(patient, MonitorEvent.Symptom.HIGH_TEMPERATURE));
        ksession.fireAllRules();

        assertTrue(nurse.getNotifications().isEmpty());

        //Fourth event: 7 minutes after the last one
        clock.advanceTime(7, TimeUnit.MINUTES);
        bedEventsEP.insert(new MonitorEvent(patient, MonitorEvent.Symptom.HIGH_TEMPERATURE));
        ksession.fireAllRules();
       
        assertEquals(1,nurse.getNotifications().size());
        nurse.clearNotifications();

    }
View Full Code Here

Examples of org.plugtree.training.model.Nurse

        final StatefulKnowledgeSession ksession = this.createKSession();
        WorkingMemoryEntryPoint bedEventsEP = ksession.getWorkingMemoryEntryPoint("bed-events");

        Patient patient = new Patient("John","Doe");

        Nurse nurse = new Nurse("Mary","Douglas");
        ksession.setGlobal("nurse", nurse);
        Doctor doctor = new Doctor("Gregory","House");
        ksession.setGlobal("doctor", doctor);

        assertTrue(doctor.getNotifications().isEmpty());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.