System.out.println("GET client called");
String client;
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());
hcs_fn.setUnhashed(s50_fn);
p.setLegalFirstName(hcs_fn);
HashingChoiceStamped hcs_ln = new HashingChoiceStamped();
String50 s50_ln = (new String50());
s50_ln.setValue(pc.getNameLast());
hcs_ln.setUnhashed(s50_ln);;
p.setLegalLastName(hcs_ln);
String50 s50_mn = new String50();
HashingChoiceStamped hcs_mn = new HashingChoiceStamped();
s50_mn.setValue(pc.getNameMiddle());
hcs_mn.setUnhashed(s50_mn);
p.setLegalMiddleName(hcs_mn);
int eth = pc.getEthnicityCode().intValue();
if (Integer.valueOf(eth) != null ) {
FourValDKRefusedHashingChoice fourVal_hc = new FourValDKRefusedHashingChoice();
FourValDKRefusedStatic fourVal_Static = new FourValDKRefusedStatic();
eth = EthnicityMap.map(eth);
if (eth != -1) {
fourVal_Static.setValue((long)eth);
fourVal_hc.setUnhashed(fourVal_Static);
p.setEthnicity(fourVal_hc);
}
}
int gen = pc.getGenderCode().intValue();
if (Integer.valueOf(gen) != null ) {
SevenValDKRefusedHashingChoice sevenValDKRef_hc = new SevenValDKRefusedHashingChoice();
SevenValDKRefused sevenValDKRef = new SevenValDKRefused();
gen = GenderMap.map(gen);
if (gen != -1) {
sevenValDKRef.setValue((long)gen);
sevenValDKRef_hc.setUnhashed(sevenValDKRef);
p.setGender(sevenValDKRef_hc);
}
}
try {
int race = pc.getRaceCode().intValue();
if (Integer.valueOf(race) != null ) {
SevenValDKRefused2HashingChoiceStatic sevenValDKRef_hcs = new SevenValDKRefused2HashingChoiceStatic();
SevenValDKRefused2Static sevenValDKRef2S = new SevenValDKRefused2Static();
race = RaceMap.map(race);
if (race != -1) {
sevenValDKRef2S.setValue((long)race);
sevenValDKRef_hcs.setUnhashed(sevenValDKRef2S);
p.getRace().add(sevenValDKRef_hcs);
}
}
} catch (Exception e){e.printStackTrace();}
if (pc.getDateOfBirth() !=null) {
DOBHashingChoice dobhc = new DOBHashingChoice();
DateStatic ds = new DateStatic();
GregorianCalendar c = new GregorianCalendar();
c.setTime(pc.getDateOfBirth());
try {
XMLGregorianCalendar gc = DatatypeFactory.newInstance().newXMLGregorianCalendar(c);
gc.setTimezone(DatatypeConstants.FIELD_UNDEFINED);
gc.setTime(DatatypeConstants.FIELD_UNDEFINED, DatatypeConstants.FIELD_UNDEFINED, DatatypeConstants.FIELD_UNDEFINED);
ds.setValue(gc);
} catch (DatatypeConfigurationException e) {e.printStackTrace();}
dobhc.setUnhashed(ds);
p.setDateOfBirth(dobhc);
}
Marshaller marshaller = jc.createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
//NamespacePrefixMapper namespacePrefixMapper = new NamespacePrefixMapper();
//marshaller.setProperty( "com.sun.xml.bind.namespacePrefixMapper", namespacePrefixMapper);