/**
   * Testfor current or obsolete conceptb.
   *
   * @throws LBException the LB exception
   */
  public void testforCurrentOrObsoleteConceptb() throws LBException {

    // same as above, but this time, using the new methods (that aren't deprecated)
    CodedNodeSet cns =
        ServiceHolder.instance().getLexBIGService().getCodingSchemeConcepts(THES_SCHEME, null);
    cns = cns.restrictToStatus(ActiveOption.ACTIVE_ONLY, null);
    cns =
        cns.restrictToCodes(
            Constructors.createConceptReferenceList(new String[] {"C38389"}, THES_SCHEME));
    ResolvedConceptReference[] rcr =
        cns.resolveToList(null, null, null, 0).getResolvedConceptReference();

    assertTrue("1", rcr.length == 0);

    cns = ServiceHolder.instance().getLexBIGService().getCodingSchemeConcepts(THES_SCHEME, null);
    cns = cns.restrictToStatus(ActiveOption.ALL, null);
    cns =
        cns.restrictToCodes(
            Constructors.createConceptReferenceList(new String[] {"C38389"}, THES_SCHEME));
    rcr = cns.resolveToList(null, null, null, 0).getResolvedConceptReference();

    assertTrue("2", rcr.length == 1);

    // same test again - no status restriction
    cns = ServiceHolder.instance().getLexBIGService().getCodingSchemeConcepts(THES_SCHEME, null);
    cns =
        cns.restrictToCodes(
            Constructors.createConceptReferenceList(new String[] {"C38389"}, THES_SCHEME));
    rcr = cns.resolveToList(null, null, null, 0).getResolvedConceptReference();

    assertTrue("3", rcr.length == 1);

    // add a status restriction
    cns = ServiceHolder.instance().getLexBIGService().getCodingSchemeConcepts(THES_SCHEME, null);
    cns =
        cns.restrictToMatchingDesignations(
            "Sex Not Known", SearchDesignationOption.ALL, "exactMatch", null);
    cns = cns.restrictToStatus(ActiveOption.INACTIVE_ONLY, null);
    rcr = cns.resolveToList(null, null, null, 0).getResolvedConceptReference();
    assertTrue("4", rcr.length == 1);

    assertFalse("6", rcr[0].getReferencedEntry().getIsActive().booleanValue());
  }
Ejemplo n.º 2
0
  public void testT1_FNC_02() throws LBException {

    CodedNodeSet cns =
        ServiceHolder.instance().getLexBIGService().getCodingSchemeConcepts(THES_SCHEME, null);
    cns.restrictToCodes(
        Constructors.createConceptReferenceList(
            new String[] {"Vallecula", "Palate", "Hard_Palate"}, THES_SCHEME));

    // this test is really lacking... but here is how you subset. You can
    // serialize however
    // you want from here...
    assertTrue(cns.resolveToList(null, null, null, 0).getResolvedConceptReference().length == 3);
  }
  /**
   * Test retrieve most recent versionof concept.
   *
   * @throws LBException the LB exception
   */
  public void testRetrieveMostRecentVersionofConcept() throws LBException {

    // not providing a version number gets you the PRODUCTION (which can be assumed to be the latest
    // good version)

    CodedNodeSet cns =
        ServiceHolder.instance().getLexBIGService().getCodingSchemeConcepts(THES_SCHEME, null);
    cns =
        cns.restrictToCodes(
            Constructors.createConceptReferenceList(new String[] {"C12223"}, THES_SCHEME));

    assertTrue(cns.resolveToList(null, null, null, 0).getResolvedConceptReference().length == 1);
  }