static void setPatient(RcopiaUser user, RequestParameters params) throws IOException { long patientID = params.getInt(PATIENT_ID); Patient patient = null; if (patientID != 0) { // patient = user.getPatient(patientID); patient = Patient.create(user, user.getDb(PATIENT).getByID(patientID)); if (patient == null) throw new PatientNotFoundException("Patient " + patientID + " is not in your list."); user.getCache().put(patient); } else { patient = getExternalPatient(user, params); } user.setPatient(patient); if (patient == null) { if (patientID == 0) { String externalID = params.getString(EXTERNAL_PATIENT_ID); throw new PatientNotFoundException("Patient " + externalID + " is not in your list."); } else { throw new PatientNotFoundException("Patient " + patientID + " is not in your list."); } } long linkedID = patient.getInt(LINKED_ID); if (linkedID != 0) { Patient alias = user.getPatient(linkedID); if (alias != null) user.setPatient(alias); } }
public ArrayList gerDrugHistories(Patient patient) throws IOException { user.loadRxHubRequestConfig(patient.getPracticeID(), SERVICE); EligibilityProcessor eligibilityProcessor = new EligibilityProcessor(patient, user, SERVICE); ArrayList<EligibilityCheck> checks = eligibilityProcessor.getEligibility(); ArrayList<DrugHistoryResult> results = getDrugHistoryForACMedHx(patient, checks); return results; }