@Test public void pcrBetween9And12MonthsAge_shouldReturnPatientsWithPcrBetween9And12MonthsAge() throws Exception { Concept pcrTest = Dictionary.getConcept(Dictionary.HIV_DNA_POLYMERASE_CHAIN_REACTION); Concept detected = Dictionary.getConcept(Dictionary.DETECTED); Concept hivTest = Dictionary.getConcept(Dictionary.HIV_STATUS); Concept positive = Dictionary.getConcept(Dictionary.POSITIVE); Concept poorSampleQuality = Dictionary.getConcept(Dictionary.POOR_SAMPLE_QUALITY); Concept contexualStatus = Dictionary.getConcept(Dictionary.TEXT_CONTEXT_STATUS); Concept initial = Dictionary.getConcept(Dictionary.TEST_STATUS_INITIAL); Concept complete = Dictionary.getConcept(Dictionary.CONFIRMATION_STATUS); TestUtils.saveObs(TestUtils.getPatient(6), pcrTest, detected, TestUtils.date(2008, 5, 19)); TestUtils.saveObs(TestUtils.getPatient(7), pcrTest, poorSampleQuality, TestUtils.date(2013, 6, 15)); TestUtils.saveObs(TestUtils.getPatient(8), hivTest, positive, TestUtils.date(2013, 6, 20)); TestUtils.saveObs(TestUtils.getPatient(6), contexualStatus, initial, TestUtils.date(2008, 5, 19)); TestUtils.saveObs(TestUtils.getPatient(7), contexualStatus, complete, TestUtils.date(2013, 6, 15)); CohortDefinition cd = mchcsCohortLibrary.pcrBetween9And12MonthsAge(); context.addParameterValue("onOrAfter", TestUtils.date(2008, 4, 19)); context.addParameterValue("onOrBefore", TestUtils.date(2008, 5, 19)); EvaluatedCohort evaluated = Context.getService(CohortDefinitionService.class).evaluate(cd, context); ReportingTestUtils.assertCohortEquals(Arrays.asList(6), evaluated); }
public CohortDefinition pcrBetween9And12MonthsAge() { CompositionCohortDefinition cd = new CompositionCohortDefinition(); cd.addParameter(new Parameter("onOrAfter", "After Date", Date.class)); cd.addParameter(new Parameter("onOrBefore", "Before Date", Date.class)); cd.addSearch("pcrWithinMonths", ReportUtils.map(pcrWithinMonths(), "onOrAfter=${onOrAfter},onOrBefore=${onOrBefore}")); cd.addSearch("pcrInitialTest", ReportUtils.map(pcrInitialTest(), "onOrAfter=${onOrAfter},onOrBefore=${onOrBefore}")); cd.addSearch("ageBetween9And12Months", ReportUtils.map(ageBetween9And12Months(), "effectiveDate=${onOrBefore}")); cd.setCompositionString("pcrWithinMonths AND pcrInitialTest AND ageBetween9And12Months"); return cd; }
MchcsCohortLibrary { public CohortDefinition pcrBetween9And12MonthsAge() { CompositionCohortDefinition cd = new CompositionCohortDefinition(); cd.addParameter(new Parameter("onOrAfter", "After Date", Date.class)); cd.addParameter(new Parameter("onOrBefore", "Before Date", Date.class)); cd.addSearch("pcrWithinMonths", ReportUtils.map(pcrWithinMonths(), "onOrAfter=${onOrAfter},onOrBefore=${onOrBefore}")); cd.addSearch("pcrInitialTest", ReportUtils.map(pcrInitialTest(), "onOrAfter=${onOrAfter},onOrBefore=${onOrBefore}")); cd.addSearch("ageBetween9And12Months", ReportUtils.map(ageBetween9And12Months(), "effectiveDate=${onOrBefore}")); cd.setCompositionString("pcrWithinMonths AND pcrInitialTest AND ageBetween9And12Months"); return cd; } }
MchcsCohortLibrary { public CohortDefinition pcrBetween9And12MonthsAge() { CompositionCohortDefinition cd = new CompositionCohortDefinition(); cd.addParameter(new Parameter("onOrAfter", "After Date", Date.class)); cd.addParameter(new Parameter("onOrBefore", "Before Date", Date.class)); cd.addSearch("pcrWithinMonths", ReportUtils.map(pcrWithinMonths(), "onOrAfter=${onOrAfter},onOrBefore=${onOrBefore}")); cd.addSearch("pcrInitialTest", ReportUtils.map(pcrInitialTest(), "onOrAfter=${onOrAfter},onOrBefore=${onOrBefore}")); cd.addSearch("ageBetween9And12Months", ReportUtils.map(ageBetween9And12Months(), "effectiveDate=${onOrBefore}")); cd.setCompositionString("pcrWithinMonths AND pcrInitialTest AND ageBetween9And12Months"); return cd; }  }
MchcsCohortLibrary { public CohortDefinition pcrBetween9And12MonthsAge() { CompositionCohortDefinition cd = new CompositionCohortDefinition(); cd.addParameter(new Parameter("onOrAfter", "After Date", Date.class)); cd.addParameter(new Parameter("onOrBefore", "Before Date", Date.class)); cd.addSearch("pcrWithinMonths", ReportUtils.map(pcrWithinMonths(), "onOrAfter=${onOrAfter},onOrBefore=${onOrBefore}")); cd.addSearch("pcrInitialTest", ReportUtils.map(pcrInitialTest(), "onOrAfter=${onOrAfter},onOrBefore=${onOrBefore}")); cd.addSearch("ageBetween9And12Months", ReportUtils.map(ageBetween9And12Months(), "effectiveDate=${onOrBefore}")); cd.setCompositionString("pcrWithinMonths AND pcrInitialTest AND ageBetween9And12Months"); return cd; }  CohortDefinition pcrWithinMonths(); CohortDefinition pcrInitialTest(); CohortDefinition age2Months(); CohortDefinition pcrInitialWithin2Months(); CohortDefinition ageBetween3And8Months(); CohortDefinition pcrInitialBetween3To8Months(); CohortDefinition serologyAntBodyTest(); CohortDefinition ageBetween9And12Months(); CohortDefinition serologyAntBodyTestBetween9And12Months(); CohortDefinition pcrBetween9And12MonthsAge(); CohortDefinition totalHeitestedBy12Months(); CohortDefinition detectedConfirmedStatus(); CohortDefinition pcrConfirmedPositive2Months(); CohortDefinition pcrConfirmedPositiveBetween3To8Months(); CohortDefinition pcrConfirmedPositiveBetween9To12Months(); CohortDefinition pcrTotalConfirmedPositive(); CohortDefinition ageAt6Months(); CohortDefinition exclusiveBreastFeeding(); CohortDefinition exclusiveReplacementFeeding(); CohortDefinition mixedFeeding(); CohortDefinition exclusiveBreastFeedingAtSixMonths(); CohortDefinition exclusiveReplacementFeedingAtSixMonths(); CohortDefinition mixedFeedingAtSixMonths(); CohortDefinition totalExposedAgedSixMoths(); CohortDefinition motherOnTreatmentAndBreastFeeding(); CohortDefinition motherOnTreatmentAndNotBreastFeeding(); CohortDefinition motherOnTreatmentAndNotBreastFeedingUnknown(); CohortDefinition totalBreastFeedingMotherOnTreatment(); CohortDefinition hivExposedInfants(); CohortDefinition hivExposedInfantsWithin2Months(); CohortDefinition hivExposedInfantsEligibleForCTX(); CohortDefinition hivExposedInfantsWithin2MonthsAndEligibleForCTX(); CohortDefinition scheduledVisitsInCWC(); }
MchcsCohortLibrary { public CohortDefinition pcrBetween9And12MonthsAge() { CompositionCohortDefinition cd = new CompositionCohortDefinition(); cd.addParameter(new Parameter("onOrAfter", "After Date", Date.class)); cd.addParameter(new Parameter("onOrBefore", "Before Date", Date.class)); cd.addSearch("pcrWithinMonths", ReportUtils.map(pcrWithinMonths(), "onOrAfter=${onOrAfter},onOrBefore=${onOrBefore}")); cd.addSearch("pcrInitialTest", ReportUtils.map(pcrInitialTest(), "onOrAfter=${onOrAfter},onOrBefore=${onOrBefore}")); cd.addSearch("ageBetween9And12Months", ReportUtils.map(ageBetween9And12Months(), "effectiveDate=${onOrBefore}")); cd.setCompositionString("pcrWithinMonths AND pcrInitialTest AND ageBetween9And12Months"); return cd; }  CohortDefinition pcrWithinMonths(); CohortDefinition pcrInitialTest(); CohortDefinition age2Months(); CohortDefinition pcrInitialWithin2Months(); CohortDefinition ageBetween3And8Months(); CohortDefinition pcrInitialBetween3To8Months(); CohortDefinition serologyAntBodyTest(); CohortDefinition ageBetween9And12Months(); CohortDefinition serologyAntBodyTestBetween9And12Months(); CohortDefinition pcrBetween9And12MonthsAge(); CohortDefinition totalHeitestedBy12Months(); CohortDefinition detectedConfirmedStatus(); CohortDefinition pcrConfirmedPositive2Months(); CohortDefinition pcrConfirmedPositiveBetween3To8Months(); CohortDefinition pcrConfirmedPositiveBetween9To12Months(); CohortDefinition pcrTotalConfirmedPositive(); CohortDefinition ageAt6Months(); CohortDefinition exclusiveBreastFeeding(); CohortDefinition exclusiveReplacementFeeding(); CohortDefinition mixedFeeding(); CohortDefinition exclusiveBreastFeedingAtSixMonths(); CohortDefinition exclusiveReplacementFeedingAtSixMonths(); CohortDefinition mixedFeedingAtSixMonths(); CohortDefinition totalExposedAgedSixMoths(); CohortDefinition motherOnTreatmentAndBreastFeeding(); CohortDefinition motherOnTreatmentAndNotBreastFeeding(); CohortDefinition motherOnTreatmentAndNotBreastFeedingUnknown(); CohortDefinition totalBreastFeedingMotherOnTreatment(); CohortDefinition hivExposedInfants(); CohortDefinition hivExposedInfantsWithin2Months(); CohortDefinition hivExposedInfantsEligibleForCTX(); CohortDefinition hivExposedInfantsWithin2MonthsAndEligibleForCTX(); CohortDefinition scheduledVisitsInCWC();  }