Package ke.go.moh.oec

Examples of ke.go.moh.oec.PersonRequest


     */
    @Test
    public void testNotifyPersonChanged() {
        System.out.println("Testing Nofify Person Changed");
        int requestTypeId = RequestTypeId.NOTIFY_PERSON_CHANGED;
        PersonRequest requestData = new PersonRequest();
        Person p = new Person();
        List<PersonIdentifier> personIdentifierList = new ArrayList<PersonIdentifier>();
        PersonIdentifier personIdentifier = new PersonIdentifier();
        personIdentifier.setIdentifier("14080-05284/2007");
        personIdentifier.setIdentifierType(PersonIdentifier.Type.cccLocalId);
        personIdentifierList.add(personIdentifier);
        p.setPersonIdentifierList(personIdentifierList);
        p.setFirstName("Caroline");
        p.setMiddleName("Nasubo");
        p.setLastName("Nyegenye");
        p.setSex(Person.Sex.F);
//        p.setExpectedDeliveryDate(parseDate("2011-06-02"));
//        p.setPregnancyEndDate(parseDate("2011-06-02"));
//        p.setPregnancyOutcome(Person.PregnancyOutcome.multipleBirths);
//        p.setAliveStatus(Person.AliveStatus.no);
//        p.setDeathdate(parseDate("2011-09-11"));
        p.setVillageName("Tebs");
        p.setPreviousVillageName("Tengecha");
        p.setLastMoveDate(parseDate("2011-09-01"));
        Visit visit = new Visit();
        visit.setAddress("ke.go.moh.facility.14080.mch.reception");
        visit.setVisitDate(new Date());
        p.setLastRegularVisit(visit);
        requestData.setPerson(p);
        requestData.setDestinationName("Clinical Document Store");
        requestData.setDestinationAddress("ke.go.moh.facility.14080.cds");
        mediator.getData(requestTypeId, requestData);
       
    }
View Full Code Here


    }

    public SearchProcessResult findHouseholdMembers(PersonWrapper searchPersonWrapper) {
        List<Person> householdMemberList = new ArrayList<Person>();
        RequestResult kisumuHdssRequestResult = new RequestResult();
        PersonRequest personRequest = new PersonRequest();
        personRequest.setRequestReference(session.getReference());
        personRequest.setPerson(searchPersonWrapper.unwrap());
        RequestDispatcher.dispatch(personRequest, kisumuHdssRequestResult,
                RequestDispatcher.DispatchType.FIND, Server.KISUMU_HDSS);
        if (kisumuHdssRequestResult.isSuccessful()) {
            List<Person> searchPersonList = (List<Person>) kisumuHdssRequestResult.getData();
            if (!searchPersonList.isEmpty()) {
View Full Code Here

    private void getWork() {
        RequestDispatcher.dispatch(createDummyWork(), RequestDispatcher.DispatchType.GET_WORK, Server.CDS);
    }

    private PersonRequest createPersonRequest(PersonWrapper personWrapper) {
        PersonRequest personRequest = new PersonRequest();
        personRequest.setPerson(personWrapper.unwrap());
        personRequest.setRequestReference(session.getReference());
        return personRequest;
    }
View Full Code Here

    }

    public void testNotifyPersonChanged() {
        System.out.println("Testing Nofify Person Changed");
        int requestTypeId = RequestTypeId.NOTIFY_PERSON_CHANGED;
        PersonRequest requestData = new PersonRequest();
        Person p = new Person();
        List<PersonIdentifier> personIdentifierList = new ArrayList<PersonIdentifier>();
        PersonIdentifier personIdentifier = new PersonIdentifier();
        personIdentifier.setIdentifier("14080-05284/2007");
        personIdentifier.setIdentifierType(PersonIdentifier.Type.cccLocalId);
        personIdentifierList.add(personIdentifier);
        p.setPersonIdentifierList(personIdentifierList);
        p.setFirstName("Caroline");
        p.setMiddleName("Nasubo");
        p.setBirthdate(parseDate("1970-06-02"));
        p.setLastName("Nyegenye");
        p.setSex(Person.Sex.F);
//        p.setExpectedDeliveryDate(parseDate("2011-06-02"));
//        p.setPregnancyEndDate(parseDate("2011-06-02"));
//        p.setPregnancyOutcome(Person.PregnancyOutcome.multipleBirths);
        p.setAliveStatus(Person.AliveStatus.no);
        p.setDeathdate(parseDate("2011-09-11"));
        p.setVillageName("Tebs");
        p.setPreviousVillageName("Tengecha");
        p.setLastMoveDate(parseDate("2011-09-01"));
        Visit visit = new Visit();
        visit.setAddress("ke.go.moh.facility.14080.tb.reception");
        visit.setVisitDate(new Date());
        p.setLastRegularVisit(visit);
        requestData.setPerson(p);
        requestData.setDestinationName("Clinical Document Store");
        requestData.setDestinationAddress("ke.go.moh.facility.14080.cds");
        mediator.getData(requestTypeId, requestData);
        System.exit(0);
    }
View Full Code Here

    @Test
    public void testFindPerson() {
        System.out.println("JUnit Test getData - findPerson");
        String instanceName = Mediator.getProperty("Instance.Name");
        System.out.println("Instance.Name = '" + instanceName + "'");
        PersonRequest requestData = new PersonRequest();
        Person p = new Person();
        requestData.setPerson(p);
        Object result;
        PersonResponse pr;
        List<Person> pList;

        // Name that will not be found
        p.setFirstName("O<NotAFirstName");
        p.setClanName("O\"NotAClanName");
        result = mediator.getData(RequestTypeId.FIND_PERSON_MPI, requestData);
        assertNotNull(result);
        assertSame(PersonResponse.class, result.getClass());
        pr = (PersonResponse) result;
        assertTrue(pr.isSuccessful());
        assertNull(pr.getPersonList());

        // Clan name having 8 matches in the first 100 people
        p.setClanName("KONYANGO");
        result = mediator.getData(RequestTypeId.FIND_PERSON_MPI, requestData);
        assertNotNull(result);
        assertSame(PersonResponse.class, result.getClass());
        pr = (PersonResponse) result;
        assertTrue(pr.isSuccessful());
        pList = pr.getPersonList();
        assertNotNull(pList);
        int pCount = pList.size();
        assertEquals(pCount, 8);

        for (Person person : pList) {
            System.out.println("guid: " + person.getPersonGuid()
                    + " score: " + person.getMatchScore()
                    + " name: " + n(person.getFirstName()) + " " + n(person.getMiddleName()) + " " + n(person.getLastName()) + " [" + n(person.getOtherName()) + "]"
                    + " sex: " + n(person.getSex())
                    + " birth/death: " + n(person.getBirthdate()) + "/" + n(person.getDeathdate())
                    + " clan: " + n(person.getClanName())
                    + " mother: " + n(person.getMothersFirstName()) + " " + n(person.getMothersMiddleName()) + " " + n(person.getMothersLastName())
                    + " father: " + n(person.getFathersFirstName()) + " " + n(person.getFathersMiddleName()) + " " + n(person.getFathersLastName())
                    + " compHead: " + n(person.getCompoundHeadFirstName()) + " " + n(person.getCompoundHeadMiddleName()) + " " + n(person.getCompoundHeadLastName())
                    + " village: " + n(person.getVillageName())
                    + " marital: " + n(person.getMaritalStatus()));
        }

        for (int i = 0; i < pList.size(); i++) {
            Person person = pList.get(i);
            assertNotNull(person.getFirstName());
            assertNotNull(person.getMiddleName());
            assertNotNull(person.getLastName());
            // Make sure every returned person GUID is unique:
            // Make sure every returned birthdate is unique:
            for (int j = 0; j < i; j++) {
                Person pj = pList.get(j);
                assertFalse(pj.getPersonGuid().equals(person.getPersonGuid()));
                assertFalse(pj.getBirthdate().equals(person.getBirthdate()));
            }
        }
        Person p0 = pList.get(0);
        int score = p0.getMatchScore();
        assertEquals(score, 100);
        requestData.setPerson(p0);
        requestData.setRequestReference(pr.getRequestReference());
        result = mediator.getData(RequestTypeId.MODIFY_PERSON_MPI, requestData);
       
        // Exercise fingerprint matching code
        p0 = new Person();
        List<Fingerprint> fpList = new ArrayList<Fingerprint>();
        byte[] b = {1, 2, 3};
        Fingerprint f = new Fingerprint();
        f.setTemplate(b);
        f.setFingerprintType(Fingerprint.Type.rightRingFinger);
        f.setTechnologyType(Fingerprint.TechnologyType.griauleTemplate);
        fpList.add(f);
        p0.setFingerprintList(fpList);
        requestData.setPerson(p0);
        pr = callFindPerson(requestData);
    }
View Full Code Here

     * FindPerson test of getData method, of class Mediator.
     */
    @Test
    public void testFindPersonLPI() {
        System.out.println("JUnit Test getData - findPerson in the LPI");
        PersonRequest requestData = new PersonRequest();
        Person p = new Person();
        requestData.setPerson(p);
        Object result;
        PersonResponse pr;
        List<Person> pList;

        PersonIdentifier pi = new PersonIdentifier();
        pi.setIdentifier("00007/2004");
        pi.setIdentifierType(PersonIdentifier.Type.cccLocalId);
        List<PersonIdentifier> piList = new ArrayList<PersonIdentifier>();
        piList.add(pi);
        p.setPersonIdentifierList(piList);
        p.setSiteName("Siaya");
        requestData.setPerson(p);
        pr = callFindPerson(requestData);
        assertNotNull(pr);
        if (pr != null) {
            pList = pr.getPersonList();
            if (pList != null && !pList.isEmpty()) {
                p = pList.get(0);
                requestData.setPerson(p);
                requestData.setRequestReference(pr.getRequestReference());
                result = mediator.getData(RequestTypeId.MODIFY_PERSON_MPI, requestData);
            }
        }
    }
View Full Code Here

     * Test of getData method, request type CREATE_PERSON_MPI
     */
    @Test
    public void testModifyPerson() {
        System.out.println("testModifyPerson");
        PersonRequest requestData = new PersonRequest();
        Person p;
        List<Person> pList;
        PersonIdentifier pi;
        List<PersonIdentifier> piList;
        int pCount;
        Object result;
        PersonResponse pr;

        // Modify the person (will not exist) -- just to test QueueManager
        p = new Person();
        requestData.setPerson(p);
        pi = new PersonIdentifier();
        piList = new ArrayList<PersonIdentifier>();
        pi.setIdentifier("33333-44444");
        pi.setIdentifierType(PersonIdentifier.Type.patientRegistryId);
        piList.add(pi);
View Full Code Here

     * @param address Address of the reception system where the person was last seen for a regular visit.
     */
    private static void sendNotify(Person per, String address) {
        String facility = address.substring(0, address.indexOf(".facility.") + 15);
        String destination = facility + ".cds";
        PersonRequest pr = new PersonRequest();
        pr.setPerson(per);
        pr.setDestinationAddress(destination);
        pr.setDestinationName("Clinical Document Store");
        Mediator mediator = Main.getMediator();
        mediator.getData(RequestTypeId.NOTIFY_PERSON_CHANGED, pr);
    }
View Full Code Here

                    m.getMessageData().getClass().getName());
            return doc;
        }
        if (m.getXml() == null) { // Skip the following if we have pre-formed XML:
            Person p = null;
            PersonRequest personRequest = (PersonRequest) m.getMessageData();
            p = personRequest.getPerson();
            packPerson(personNode, p);
            if (personRequest.isResponseRequested()) {
                packTagValue(root, "acceptAckCode", "AL"); // Request "ALways" acknowedge.
            }
        }
        return doc;
    }
View Full Code Here

            Logger.getLogger(XmlPacker.class.getName()).log(Level.SEVERE,
                    "packFindPersonMessage() - Expected data class PersonRequest, got {0}",
                    m.getMessageData().getClass().getName());
        }
        if (m.getXml() == null) { // Skip the following if we have pre-formed XML:
            PersonRequest personRequest = (PersonRequest) m.getMessageData();
            Person p = personRequest.getPerson();
            packPersonName(q, p, "livingSubjectName");
            packTagValueAttribute(q, "livingSubjectAdministrativeGender", "code", packEnum(p.getSex()));
            packTagValueAttribute(q, "livingSubjectBirthTime", "value", packDate(p.getBirthdate()));
            packTagValueAttribute(q, "livingSubjectDeceasedTime", "value", packDate(p.getDeathdate()));
            packLivingSubjectId(q, OID_OTHER_NAME, p.getOtherName());
View Full Code Here

TOP

Related Classes of ke.go.moh.oec.PersonRequest

Copyright © 2018 www.massapicom. 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.