// RPC API public AllergiesReactants getAllergiesReactants(String dfn) throws Exception { // setDefaultContext("OR CPRS GUI CHART"); setDefaultContext("VPS AVS INTERFACE"); // setDefaultRpcName("ORQQAL LIST"); setDefaultRpcName("VPS AL LIST"); List<String> list = lCall(dfn); /* Returns array of patient allergies. Returned data is delimited by "^" and includes: allergen/reactant, reactions/symptoms (multiple symptoms/ reactions are possible - delimited by ";"), severity, allergy id (record number from the Patient Allergies file (#120.8). */ AllergiesReactants allergiesReactants = new AllergiesReactants(); if (list.size() == 1) { String a = StringUtils.piece((String) list.get(0), 2); if (a.equalsIgnoreCase("no known allergies")) { allergiesReactants.setNoKnownAllergies(true); list.clear(); } else if (a.equalsIgnoreCase("no allergy assessment")) { allergiesReactants.setNoAllergyAssessment(true); list.clear(); } } List<AllergyReactant> allergiesReactantsList = new ArrayList<AllergyReactant>(); for (String s : list) { AllergyReactant allergyReactant = new AllergyReactant(); allergyReactant.setDfn(dfn); allergyReactant.setIen(StringUtils.piece(s, 1)); allergyReactant.setAllergenReactant(StringUtils.piece(s, 2)); allergyReactant.setSeverity(StringUtils.piece(s, 3)); String[] x = StringUtils.pieceList(StringUtils.piece(s, 4), ';'); allergyReactant.setReactionsSymptoms(x); allergiesReactantsList.add(allergyReactant); } allergiesReactants.setAllergiesReactants(allergiesReactantsList); return allergiesReactants; }