private static int doCompareByDrug(RcopiaUser user, Prescription one, ScripMed two) throws IOException { long oneID = one.getInt(DRUG_ID); long twoID = two.getInt(DRUG_ID); int match = new DrugMatcher(user).match(oneID, twoID); switch (match) { case MATCH_INSUFFICIENT: case MATCH_NONE: case MATCH_NAME: return match; case MATCH_FORMULA: default: Debug.println("Formula matched."); if (sigsMatch(one, two)) { Debug.println("Sig matched."); if (quantitiesMatch(one, two)) return MATCH_QUANTITY; else return MATCH_SIG; } else { return MATCH_FORMULA; } } }
private ArrayList getDrugHistoryForACMedHx(Patient patient, ArrayList<EligibilityCheck> checks) throws IOException { logger.info("Entering DrugHistoryProcessor.getDrugHistoryForACMedHx()"); int interval = getDrugHistoryInterval(); if (interval <= 0) { Debug.println("BET: auto-check of drug history disabled."); return null; } Debug.println("BET: Checking Drug History..."); DrugHistoryChecker checker = DrugHistoryChecker.create(user, SERVICE); Date endDate = new Date(); Date startDate = DateConverter.add(endDate, Calendar.DATE, -interval); checker.setDates(startDate, endDate); checker.setPatient(patient); checker.setEligibilityChecK(checks); checker.setService(SERVICE); /** Main thread waits for DH to be done. */ checker.run(); logger.info("Exiting DrugHistoryProcessor.getDrugHistoryForACMedHx()"); return checker.getResults(); }
private static int doCompare(RcopiaUser user, Prescription one, ScripMed two) throws IOException { Debug.println( "Comparing " + one.getID() + ":" + one.getName() + " against " + two.getID() + ":" + two.getName()); int match = doCompareByDrug(user, one, two); if (match != MATCH_INSUFFICIENT) return match; return doCompareByName(user, one, two); }