Examples of SiteServiceParticipation


Examples of org.pathways.openciss.info.hmis.schema._3_0.hud_hmis.SiteServiceParticipation

        if (xmlr7.isStartElement()) {
          //System.out.println("local name is: " + xmlr.getLocalName());
          if (xmlr7.getLocalName().equals("SiteServiceParticipation")) {
            xmlr7.require(XMLStreamConstants.START_ELEMENT, null, "SiteServiceParticipation");
            JAXBElement<SiteServiceParticipation> siteServiceParticipationJAXB = unmarshaller.unmarshal(xmlr7, SiteServiceParticipation.class);
            SiteServiceParticipation siteServiceParticipationElement = (SiteServiceParticipation)siteServiceParticipationJAXB.getValue();
            //Get only this household's SiteServiceParticipations            
            try {
              String hhid = siteServiceParticipationElement.getHouseholdID().getIDStr();
              if (hhid != null && !hhid.isEmpty()) {
                if (hhid.equals(searchHHID)) {
                  log.info("siteServiceParticipationElement.getHouseholdID().getIDStr is a match for household: " + searchHHID);
                  sspArrayList.add(siteServiceParticipationElement);
                  log.info("Added an ssp with id: " + siteServiceParticipationElement.getSiteServiceParticipationID().getIDNum().toString() + " for household:" + searchHHID);
                } else {
                  log.info("siteServiceParticipationElement's hhid " + hhid + " is not a match for household: " + searchHHID);
                }
              } else {
                log.info("HouseholdID/IDStr was empty or null, so try to get the IDNum instead");
View Full Code Here

Examples of org.pathways.openciss.info.hmis.schema._3_0.hud_hmis.SiteServiceParticipation

 
  SiteServiceParticipation getOneSiteServiceParticipationForHousehold(Household household) {
    // used to ultimately get a program id for the first column of CSV2, not sure if it has any other use
    // makes the assumption that a household ID is bound to a single program.  Big assumption.
    // I think in Rosie, a household is attributed to only one agency.  Not in HUD HMIS XML where IDs link households to agency in a more dynamic way.
    SiteServiceParticipation siteServiceParticipationElement = null;
    JAXBContext jc = null;
    InputStream zis = openXMLStream(hudXMLURL);
    XMLStreamReader xmlr8 = null;
    String searchHHID = household.getHouseholdID().getIDStr();
    log.info("searching for siteserviceparticipations with household ID: " + searchHHID);
    try {
      // set up a StAX reader
      xmlr8 = xmlif.createXMLStreamReader(zis);
    } catch (Exception e) {
      log.info("exception caught creating StAX stream " + e.toString());
    }
   
    //Use StAX to retrieve serviceID (proxy for agencyID) from the SiteService
    try {
      jc = JAXBContext.newInstance(SiteServiceParticipation.class);
    } catch (JAXBException e) {
      log.info("JAXB SiteServiceParticipation.class context problem: " + e.toString());
    }
    try {
      unmarshaller = jc.createUnmarshaller();
    } catch (JAXBException e) {
      log.info("Problem unmarshalling SiteServiceParticipation context: " + e.toString());
    }
    try {
      while(xmlr8.hasNext()) {
        xmlr8.next();
        if (xmlr8.isStartElement()) {
          //System.out.println("local name is: " + xmlr.getLocalName());
          if (xmlr8.getLocalName().equals("SiteServiceParticipation")) {
            xmlr8.require(XMLStreamConstants.START_ELEMENT, null, "SiteServiceParticipation");
            JAXBElement<SiteServiceParticipation> siteServiceParticipationJAXB = unmarshaller.unmarshal(xmlr8, SiteServiceParticipation.class);
            siteServiceParticipationElement = (SiteServiceParticipation)siteServiceParticipationJAXB.getValue();
            //Get only this household's SiteServiceParticipations            
            try {
              String hhid = siteServiceParticipationElement.getHouseholdID().getIDStr();
              if (hhid != null && !hhid.isEmpty()) {
                if (hhid.equals(searchHHID)) {
                  log.info("siteServiceParticipationElement.getHouseholdID().getIDStr is a match for household: " + searchHHID);
                  log.info("Found an ssp with id: " + siteServiceParticipationElement.getSiteServiceParticipationID().getIDNum().toString() + " for household:" + searchHHID);
                  break;
                } else {
                  log.info("siteServiceParticipationElement's hhid " + hhid + " is not a match for household: " + searchHHID);
                }
              } else {
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.