Package org.pathways.openciss.shared

Examples of org.pathways.openciss.shared.PathClientService


    try {
      // unmarshall the JSON
      JsonNode ob = mapper.readValue(incomingJSON, JsonNode.class);
      // look up this client, and add a sequential outreach
      ClientOutreach co = new ClientOutreach();
      PathClientService pcs = new PathClientService();
     
      try {
        Integer clientID = Integer.valueOf(ob.get("Client_ID").getTextValue());
        if (clientID != null) {
          System.out.println("client id is: " + clientID);
          co.setClientKey(pcs.getPathClient(clientID).getClientKey());
          //co.setClientKey(clientID.intValue());
        }
        BigDecimal latitude = BigDecimal.valueOf(Double.valueOf(ob.get("Latitude").getTextValue()));
        if (latitude != null) {
          co.setLatitude(latitude);
View Full Code Here


  @Path("delete")
  public String deleteClient(@QueryParam("id") int clientID) {
    System.out.println("DELETE client called");
    //Person p = new Person();
    boolean b;
    PathClientService pcs = new PathClientService();
    PathClient pc = pcs.getPathClient(clientID);
    if (pc  != null) { // matching record found
      try {
        //b = (Boolean) pc.getInactive();
        b = (pc.getInactive())!=0;

        if (!b) { // that is, if active
          //byte by = (byte) (1);
          pc.setInactive(1); //make it inactive
          pcs.updatePathClient(pc);
        } // otherwise, it's already inactive, so leave it alone
        return "200";
      }
      catch (Exception e){e.printStackTrace();}
    }
View Full Code Here

    JAXBContext jc;
    try {
      //jc = JAXBContext.newInstance("info.hmis.schema._3_0.hud_hmis");
      Person p = new Person();
      jc = JAXBContext.newInstance(p.getClass());
      PathClientService pcs = new PathClientService();
      PathClient pc = pcs.getPathClient(clientID);
      if (pc  != null) {
       
        HashingChoiceStamped hcs_fn = new HashingChoiceStamped();
        String50 s50_fn = (new String50());
        s50_fn.setValue(pc.getNameFirst());
View Full Code Here

      Person person = new Person();
      JAXBContext jc = JAXBContext.newInstance(person.getClass());
      Unmarshaller unmarshaller = jc.createUnmarshaller();
      JAXBElement<?> p = unmarshaller.unmarshal(new StreamSource(new StringReader(stringBuffer.toString())), Person.class);
      Person pt = (Person)p.getValue();
      PathClientService pcs = new PathClientService();
      PathClient pc = new PathClient();
     
      try {
        String lfn = pt.getLegalFirstName().getUnhashed().getValue();
        if (lfn  != null) {
          pc.setNameFirst(lfn);
        }
      }
      catch(Exception e){log.info("Couldn't get LegalFirstName.  This is okay.");}
       
      try {
        String lln = pt.getLegalLastName().getUnhashed().getValue();
        if (lln  != null) {
          pc.setNameLast(lln);
        }
      }
      catch(Exception e){log.info("Couldn't get LegalLastName.  This is okay.");}
       
      try {
        String lmn = pt.getLegalMiddleName().getUnhashed().getValue();
        if (lmn  != null) {
          pc.setNameMiddle(lmn);
        }
      }
      catch(Exception e){log.info("Couldn't get LegalMiddleName.  This is okay.");}
       
      try {
        BigDecimal gender = new BigDecimal(pt.getGender().getUnhashed().getValue());
        if (gender  != null) {
          pc.setGenderCode(gender);
        }
      }
      catch(Exception e){log.info("Couldn't get Gender.  This is okay.");}
       
      try {       
        BigDecimal ethnicity = new BigDecimal(pt.getEthnicity().getUnhashed().getValue());
        if (ethnicity  != null) {
          pc.setEthnicityCode(ethnicity);
        }
      }
      catch(Exception e){log.info("Couldn't get Ethnicity.  This is okay.");}       
       
      try {       
        Date dob = pt.getDateOfBirth().getUnhashed().getValue().toGregorianCalendar().getTime();
        if (dob  != null) {
          pc.setDateOfBirth(dob);
        }
      }
      catch(Exception e){log.info("Couldn't get DoB.  This is okay.");}
     
      try {
        Integer ssn = Integer.valueOf(pt.getSocialSecurityNumber().getUnhashed().getValue());
        if (ssn  != null) {
          pc.setSsn(ssn);
        }
      }
      catch(Exception e){log.info("Couldn't get SSN.  This is okay.");}
     
      try {
        Integer ssnQualityCode = (int) pt.getSocialSecurityNumber().getSocialSecNumberQualityCode().getValue();
        if (ssnQualityCode  != null) {
          pc.setSsnQuality(ssnQualityCode);
        }
      }
      catch(Exception e){log.info("Couldn't get SSN Quality Code.  This is okay.");}
           
      //we only use int ids, not strings in openciss
      try {
        clientID = pt.getPersonID().getIDNum().intValue();
        if (clientID != 0) {
          pc.setClientKey(clientID);
        }
      }
      catch(Exception e){log.info("could not get person ID Number as an integer.  Maybe they sent strings or it is a client/add call?");}
     
      try {
        // assuming newly added clients aren't immediately inactivated
        if (pt.getPersonID().getDelete() == 1L) {
          pc.setInactive(1);
        } else {
          pc.setInactive(0);
        }
      }
      catch(Exception e){log.info("Could not set inactive to false");}
     
     
      if(pcs.updatePathClient(pc)) {
        return clientID;
      }   
      //client_id  is -1 if not successful, a positive number if successful
      else {
        return -1;
View Full Code Here

      Person person = new Person();
      JAXBContext jc = JAXBContext.newInstance(person.getClass());
      Unmarshaller unmarshaller = jc.createUnmarshaller();
      JAXBElement<?> p = unmarshaller.unmarshal(new StreamSource(new StringReader(stringBuffer.toString())), Person.class);
      Person pt = (Person)p.getValue();
      PathClientService pcs = new PathClientService();
      PathClient pc = new PathClient();
     
      try {
        String lfn = pt.getLegalFirstName().getUnhashed().getValue();
        if (lfn  != null) {
          pc.setNameFirst(lfn);
        }
      }
      catch(Exception e){log.info("Couldn't get LegalFirstName.  This is okay.");}
       
      try {
        String lln = pt.getLegalLastName().getUnhashed().getValue();
        if (lln  != null) {
          pc.setNameLast(lln);
        }
      }
      catch(Exception e){log.info("Couldn't get LegalLastName.  This is okay.");}
       
      try {
        String lmn = pt.getLegalMiddleName().getUnhashed().getValue();
        if (lmn  != null) {
          pc.setNameMiddle(lmn);
        }
      }
      catch(Exception e){log.info("Couldn't get LegalMiddleName.  This is okay.");}
       
      try {
        BigDecimal gender = new BigDecimal(pt.getGender().getUnhashed().getValue());
        if (gender  != null) {
          pc.setGenderCode(gender);
        }
      }
      catch(Exception e){log.info("Couldn't get Gender.  This is okay.");}
       
      try {       
        BigDecimal ethnicity = new BigDecimal(pt.getEthnicity().getUnhashed().getValue());
        if (ethnicity  != null) {
          pc.setEthnicityCode(ethnicity);
        }
      }
      catch(Exception e){log.info("Couldn't get Ethnicity.  This is okay.");}       
       
      try {       
        Date dob = pt.getDateOfBirth().getUnhashed().getValue().toGregorianCalendar().getTime();
        if (dob  != null) {
          pc.setDateOfBirth(dob);
        }
      }
      catch(Exception e){log.info("Couldn't get DoB.  This is okay.");}
     
      try {
        Integer ssn = Integer.valueOf(pt.getSocialSecurityNumber().getUnhashed().getValue());
        if (ssn  != null) {
          pc.setSsn(ssn);
        }
      }
      catch(Exception e){log.info("Couldn't get SSN.  This is okay.");}
     
      try {
        Integer ssnQualityCode = (int) pt.getSocialSecurityNumber().getSocialSecNumberQualityCode().getValue();
        if (ssnQualityCode  != null) {
          pc.setSsnQuality(ssnQualityCode);
        }
      }
      catch(Exception e){log.info("Couldn't get SSN Quality Code.  This is okay.");}
     
      //we only use int ids, not strings in openciss
      try {
        clientID = pt.getPersonID().getIDNum().intValue();
        if (clientID != 0) {
          pc.setClientKey(clientID);
        }
      }
      catch(Exception e){log.info("could not get person ID Number as an integer.  Maybe they sent id strings?");}
     
      try {
        // assuming newly added clients aren't immediately inactivated
        pc.setInactive(0);
      }
      catch(Exception e){log.info("Could not set inactive to false");}
     
        //clientID = pcs.createPathClient(pc);
      //client_id  is -1 if not successful, a positive client id number if successful
      return pcs.createPathClient(pc);
     
    } catch (JAXBException e) {
      e.printStackTrace();
      return -1;
    }
View Full Code Here

TOP

Related Classes of org.pathways.openciss.shared.PathClientService

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.