Package ke.go.moh.oec

Examples of ke.go.moh.oec.Person


     * @param e head of the <code>Document</code> subtree in which this person is to be packed
     * @param p person data to pack into the subtree
     */
    private void packPerson(Element e, Person p) {
        if (p == null) {
            p = new Person();
            //p.setLastOneOffVisit(null);
        }
        packPersonName(e, p, "name");
        packTagAttribute(e, "administrativeGenderCode", "code", packEnum(p.getSex()));
        packTagAttribute(e, "birthTime", "value", packDate(p.getBirthdate()));
View Full Code Here


            }
            for (int i = 0; i < householdMembers.size(); i++) { // From 1st person (index 0) ondwards...
                Element e = elementList.get(i);
                RelatedPerson rp = householdMembers.get(i);
                packTagAttribute(e, "code", "value", packEnum(rp.getRelation()));
                Person per = rp.getPerson();
                if (per == null) {
                    per = new Person(); // Empty person, so items below will be empty but avoid nullpointer.
                }
                packPersonName(e, per, "name");
                packTagAttribute(e, "administrativeGenderCode", "code", packEnum(per.getSex()));
                packTagAttribute(e, "birthTime", "value", packDate(per.getBirthdate()));
            }
        }
    }
View Full Code Here

     * @param e root node of the person message <code>Document</code> parsed from XML
     */
    private void unpackGenericPersonRequestMessage(Message m, Element e) {
        PersonRequest personRequest = new PersonRequest();
        m.setMessageData(personRequest);
        Person p = new Person();
        personRequest.setPerson(p);
        unpackHl7Header(m, e);
        Element ePerson = (Element) e.getElementsByTagName("patient").item(0);
        unpackPerson(p, ePerson);
        if (unpackTagValue(e, "acceptAckCode").equals("AL")) {
View Full Code Here

    private void unpackGenericPersonResponseMessage(Message m, Element e) {
        PersonResponse personResponse = new PersonResponse();
        m.setMessageData(personResponse);
        List<Person> personList = new ArrayList<Person>();
        personResponse.setPersonList(personList);
        Person p = new Person();
        personList.add(p);
        unpackHl7Header(m, e);
        Element ePerson = (Element) e.getElementsByTagName("patient").item(0);
        unpackPerson(p, ePerson);
    }
View Full Code Here

     * @param e root of the person message <code>Document</code> parsed from XML
     */
    private void unpackFindPersonMessage(Message m, Element e) {
        PersonRequest personRequest = new PersonRequest();
        m.setMessageData(personRequest);
        Person p = new Person();
        personRequest.setPerson(p);
        unpackHl7Header(m, e);
        Element q = (Element) e.getElementsByTagName("queryByParameter").item(0);

        Element el = (Element) q.getElementsByTagName("livingSubjectName").item(0);
        if (el != null) {
            unpackPersonName(p, el, "value");
        }

        p.setSex((Person.Sex) unpackEnum(Person.Sex.values(), unpackTagValueAttribute(e, "livingSubjectAdministrativeGender", "code")));
        p.setBirthdate(unpackDate(unpackTagValueAttribute(e, "livingSubjectBirthTime", "value")));
        p.setDeathdate(unpackDate(unpackTagValueAttribute(e, "livingSubjectDeceasedTime", "value")));
        p.setOtherName(unpackLivingSubjectId(q, OID_OTHER_NAME));
        p.setClanName(unpackLivingSubjectId(q, OID_CLAN_NAME));
        p.setAliveStatus((Person.AliveStatus) unpackEnum(Person.AliveStatus.values(), unpackLivingSubjectId(q, OID_ALIVE_STATUS)));
        p.setMothersFirstName(unpackLivingSubjectId(q, OID_MOTHERS_FIRST_NAME));
        p.setMothersMiddleName(unpackLivingSubjectId(q, OID_MOTHERS_MIDDLE_NAME));
        p.setMothersLastName(unpackLivingSubjectId(q, OID_MOTHERS_LAST_NAME));
        p.setFathersFirstName(unpackLivingSubjectId(q, OID_FATHERS_FIRST_NAME));
        p.setFathersMiddleName(unpackLivingSubjectId(q, OID_FATHERS_MIDDLE_NAME));
        p.setFathersLastName(unpackLivingSubjectId(q, OKD_FATHERS_LAST_NAME));
        p.setCompoundHeadFirstName(unpackLivingSubjectId(q, OID_COMPOUND_HEAD_FIRST_NAME));
        p.setCompoundHeadMiddleName(unpackLivingSubjectId(q, OID_COMPOUND_HEAD_MIDDLE_NAME));
        p.setCompoundHeadLastName(unpackLivingSubjectId(q, OID_COMPOUND_HEAD_LAST_NAME));
        p.setMaritalStatus((Person.MaritalStatus) unpackEnum(Person.MaritalStatus.values(), unpackLivingSubjectId(q, OID_MARITAL_STATUS)));
        p.setConsentSigned((Person.ConsentSigned) unpackEnum(Person.ConsentSigned.values(), unpackLivingSubjectId(q, OID_CONSENT_SIGNED)));
        p.setSiteName(unpackLivingSubjectId(q, OID_SITE_NAME));
        p.setVillageName(unpackLivingSubjectId(q, OID_VILAGE_NAME));
        unpackLivingSubjectPersonIdentifiers(p, q, OID_PATIENT_REGISTRY_ID, PersonIdentifier.Type.patientRegistryId);
        unpackLivingSubjectPersonIdentifiers(p, q, OID_MASTER_PATIENT_REGISTRY_ID, PersonIdentifier.Type.masterPatientRegistryId);
        unpackLivingSubjectPersonIdentifiers(p, q, OID_CCC_UNIVERSAL_UNIQUE_ID, PersonIdentifier.Type.cccUniqueId);
        unpackLivingSubjectPersonIdentifiers(p, q, OID_CCC_LOCAL_PATIENT_ID, PersonIdentifier.Type.cccLocalId);
        unpackLivingSubjectPersonIdentifiers(p, q, KISUMU_HDSS_ID, PersonIdentifier.Type.kisumuHdssId);
View Full Code Here

        int personCount = nodeList.getLength();
        if (personCount != 0) {
            List<Person> personList = new ArrayList<Person>(personCount);
            personResponse.setPersonList(personList);
            for (int i = 0; i < personCount; i++) {
                Person p = new Person();
                Element el = (Element) nodeList.item(i);
                unpackCandidate(p, el);
                personList.add(p);
            }
        }
View Full Code Here

                relatedPersonList.add(rp);
                Element el = (Element) nodeList.item(i);
                // Set the type of relation:
                rp.setRelation((RelatedPerson.Relation) unpackEnum(RelatedPerson.Relation.values(), unpackTagAttribute(el, "code", "value")));
                // Set the details of the new person:
                Person per = new Person();
                rp.setPerson(per);
                unpackPersonName(per, el, "name");
                per.setSex((Person.Sex) unpackEnum(Person.Sex.values(), unpackTagAttribute(el, "administrativeGenderCode", "code")));
                per.setBirthdate(unpackDate(unpackTagAttribute(el, "birthTime", "value")));
            }
        }
    }
View Full Code Here

                    colVisitRegAddress = rs.findColumn("visit_one_date");
                    colVisitOneAddress = rs.findColumn("visit_one_address");
                    colVisitRegFacility = rs.findColumn("visit_reg_facility");
                    colsFound = true;
                }
                Person p = new Person();
                int dbPersonId = rs.getInt(colPersonId);
                p.setPersonGuid(getRsString(rs, colPersonGuid));
                p.setSex((Person.Sex) ValueMap.SEX.getVal().get(getRsString(rs, colSex)));
                p.setBirthdate(rs.getDate(colBirthdate, cal));
                p.setDeathdate(rs.getDate(colDeathdate, cal));
                p.setFirstName(getRsString(rs, colFirstName));
                p.setMiddleName(getRsString(rs, colMiddleName));
                p.setLastName(getRsString(rs, colLastName));
                p.setOtherName(getRsString(rs, colOtherName));
                p.setClanName(getRsString(rs, colClanName));
                p.setMothersFirstName(getRsString(rs, colMothersFirstName));
                p.setMothersMiddleName(getRsString(rs, colMothersMiddleName));
                p.setMothersLastName(getRsString(rs, colMothersLastName));
                p.setFathersFirstName(getRsString(rs, colFathersFirstName));
                p.setFathersMiddleName(getRsString(rs, colFathersMiddleName));
                p.setFathersLastName(getRsString(rs, colFathersLastName));
                p.setCompoundHeadFirstName(getRsString(rs, colCompoundheadFirstName));
                p.setCompoundHeadMiddleName(getRsString(rs, colCompoundheadMiddleName));
                p.setCompoundHeadLastName(getRsString(rs, colCompoundheadLastName));
                p.setVillageName(getRsString(rs, colVillageName));
                p.setMaritalStatus((Person.MaritalStatus) ValueMap.MARITAL_STATUS.getVal().get(getRsString(rs, colMaritalStatusName)));
                p.setPersonIdentifierList(personIdentifierList.loadNext(dbPersonId));
                p.setFingerprintList(fingerprintList.loadNext(dbPersonId));
                p.setConsentSigned((Person.ConsentSigned) ValueMap.CONSENT_SIGNED.getVal().get(getRsString(rs, colConsentSigned)));
                p.setLastRegularVisit(Visit.getVisit(rs.getDate(colVisitRegDate), getRsString(rs, colVisitOneDate),getRsString(rs, colVisitRegFacility)));
                p.setLastOneOffVisit(Visit.getVisit(rs.getDate(colVisitRegAddress), getRsString(rs, colVisitOneAddress),getRsString(rs, colVisitRegFacility)));
                PersonMatch per = new PersonMatch(p);
                per.setDbPersonId(dbPersonId);
                personMatchList.add(per);
                if (++recordCount % 10000 == 0) {
                    double timeInterval = (System.currentTimeMillis() - startTime);
View Full Code Here

    private String searchTerm(String label, String term) {
        return term == null || term.isEmpty() ? "" : " " + label + ": " + term;
    }

    private PersonResponse callFindPerson(PersonRequest personRequest) {
        Person p = personRequest.getPerson();
        String log = "Searching for"
                + searchTerm("guid", p.getPersonGuid())
                + searchTerm("fname", p.getFirstName())
                + searchTerm("mname", p.getMiddleName())
                + searchTerm("lname", p.getLastName())
                + searchTerm("clan", p.getClanName())
                + searchTerm("other", p.getOtherName())
                + searchTerm("mfname", p.getMothersFirstName())
                + searchTerm("mmname", p.getMothersMiddleName())
                + searchTerm("mlname", p.getMothersLastName())
                + searchTerm("ffname", p.getFathersFirstName())
                + searchTerm("fmname", p.getFathersMiddleName())
                + searchTerm("flname", p.getFathersLastName())
                + searchTerm("cfname", p.getCompoundHeadFirstName())
                + searchTerm("cmname", p.getCompoundHeadMiddleName())
                + searchTerm("clname", p.getCompoundHeadLastName())
                + searchTerm("sex", n(p.getSex()))
                + searchTerm("birth", n(p.getBirthdate()))
                + searchTerm("death", n(p.getDeathdate()))
                + searchTerm("marital", n(p.getMaritalStatus()))
                + searchTerm("village", p.getVillageName())
                + searchTerm("clname", p.getCompoundHeadLastName()
                + searchTerm("site", p.getSiteName()));
        List<PersonIdentifier> piList = p.getPersonIdentifierList();
        if (piList != null) {
            for (PersonIdentifier pi : piList) {
                log += " pi(" + pi.getIdentifierType().name() + "): " + pi.getIdentifier();
            }
        }
View Full Code Here

    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

TOP

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

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.