title: Why Does My FAMILY Query Fail?
body: <p>Please have a look at the following code wherein I have a method that searches by family name and another that searches by system. Following the code I have provided the results that were produced by invoking each of these two methods. You can see that the system search returned three patients, the third one having the family name <code>Vaessen</code>. But, when I search for the family name <code>Vaessen</code> a timeout results. Would someone please help me to understand why this is happening?</p>
  
  <p>Note: As you can see from the timeout exception, I am querying the public fhir server <a href="http://fhirtest.uhn.ca/baseDstu3" rel="nofollow noreferrer">http://fhirtest.uhn.ca/baseDstu3</a></p>
  
  <pre><code>public void findPatientsInFamily(String family) {
      System.out.printf("\n\nFinding patients in family %s\n", family);
      findPatients(Patient.FAMILY.matches().value(family));
  }
  
  public void findPatientsInSystem(String system) {
      System.out.printf("\n\nFinding patients in system %s\n", system);
      findPatients(Patient.IDENTIFIER.hasSystemWithAnyCode(system));
  }
  
  @SuppressWarnings("rawtypes")
  public void findPatients(ICriterion criterion) {
  
      try {
          Bundle bundle = client.search().forResource(Patient.class).where(criterion).returnBundle(Bundle.class).execute();
  
          for (BundleEntryComponent entry : bundle.getEntry()) {
              if (entry.getResource().getResourceType() == ResourceType.Patient) {
                  Patient patient = (Patient) entry.getResource();
                  System.out.printf("%s\n", parser.encodeResourceToString(patient));
              }
          }
      }
      catch(Exception e) {
          System.out.printf("Cannot find patients\n%s\n", e.getMessage());
      }
  }
  </code></pre>
  
  <p>Results for the findPatientsInSystem(String system) method:</p>
  
  <pre><code>Finding patients in system http://dmw.levy.com/mrn
  &lt;Patient xmlns="http://hl7.org/fhir"&gt;
     &lt;id value="4172808"&gt;&lt;/id&gt;
     &lt;meta&gt;
        &lt;versionId value="1"&gt;&lt;/versionId&gt;
        &lt;lastUpdated value="2018-06-07T14:10:52.336+00:00"&gt;&lt;/lastUpdated&gt;
     &lt;/meta&gt;
     &lt;text&gt;
        &lt;status value="generated"&gt;&lt;/status&gt;
        &lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;
           &lt;div class="hapiHeaderText"&gt;Rachael 
              &lt;b&gt;LANEHART &lt;/b&gt;
           &lt;/div&gt;
           &lt;table class="hapiPropertyTable"&gt;
              &lt;tbody&gt;
                 &lt;tr&gt;
                    &lt;td&gt;Identifier&lt;/td&gt;
                    &lt;td&gt;12345&lt;/td&gt;
                 &lt;/tr&gt;
                 &lt;tr&gt;
                    &lt;td&gt;Date of birth&lt;/td&gt;
                    &lt;td&gt;
                       &lt;span&gt;30 December 1985&lt;/span&gt;
                    &lt;/td&gt;
                 &lt;/tr&gt;
              &lt;/tbody&gt;
           &lt;/table&gt;
        &lt;/div&gt;
     &lt;/text&gt;
     &lt;identifier&gt;
        &lt;system value="http://dmw.levy.com/mrn"&gt;&lt;/system&gt;
        &lt;value value="12345"&gt;&lt;/value&gt;
     &lt;/identifier&gt;
     &lt;name&gt;
        &lt;family value="Lanehart"&gt;&lt;/family&gt;
        &lt;given value="Rachael"&gt;&lt;/given&gt;
     &lt;/name&gt;
     &lt;gender value="female"&gt;&lt;/gender&gt;
     &lt;birthDate value="1985-12-30"&gt;&lt;/birthDate&gt;
  &lt;/Patient&gt;
  &lt;Patient xmlns="http://hl7.org/fhir"&gt;
     &lt;id value="4149602"&gt;&lt;/id&gt;
     &lt;meta&gt;
        &lt;versionId value="1"&gt;&lt;/versionId&gt;
        &lt;lastUpdated value="2018-06-06T20:52:11.831+00:00"&gt;&lt;/lastUpdated&gt;
     &lt;/meta&gt;
     &lt;text&gt;
        &lt;status value="generated"&gt;&lt;/status&gt;
        &lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;
           &lt;div class="hapiHeaderText"&gt;Ravi 
              &lt;b&gt;THAKKAR &lt;/b&gt;
           &lt;/div&gt;
           &lt;table class="hapiPropertyTable"&gt;
              &lt;tbody&gt;
                 &lt;tr&gt;
                    &lt;td&gt;Identifier&lt;/td&gt;
                    &lt;td&gt;12345&lt;/td&gt;
                 &lt;/tr&gt;
                 &lt;tr&gt;
                    &lt;td&gt;Date of birth&lt;/td&gt;
                    &lt;td&gt;
                       &lt;span&gt;14 April 1962&lt;/span&gt;
                    &lt;/td&gt;
                 &lt;/tr&gt;
              &lt;/tbody&gt;
           &lt;/table&gt;
        &lt;/div&gt;
     &lt;/text&gt;
     &lt;identifier&gt;
        &lt;system value="http://dmw.levy.com/mrn"&gt;&lt;/system&gt;
        &lt;value value="12345"&gt;&lt;/value&gt;
     &lt;/identifier&gt;
     &lt;name&gt;
        &lt;family value="Thakkar"&gt;&lt;/family&gt;
        &lt;given value="Ravi"&gt;&lt;/given&gt;
     &lt;/name&gt;
     &lt;gender value="male"&gt;&lt;/gender&gt;
     &lt;birthDate value="1962-04-14"&gt;&lt;/birthDate&gt;
  &lt;/Patient&gt;
  &lt;Patient xmlns="http://hl7.org/fhir"&gt;
     &lt;id value="4013201"&gt;&lt;/id&gt;
     &lt;meta&gt;
        &lt;versionId value="1"&gt;&lt;/versionId&gt;
        &lt;lastUpdated value="2018-06-01T18:30:23.902+00:00"&gt;&lt;/lastUpdated&gt;
     &lt;/meta&gt;
     &lt;text&gt;
        &lt;status value="generated"&gt;&lt;/status&gt;
        &lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;
           &lt;div class="hapiHeaderText"&gt;Robert Jozef 
              &lt;b&gt;VAESSEN &lt;/b&gt;
           &lt;/div&gt;
           &lt;table class="hapiPropertyTable"&gt;
              &lt;tbody&gt;
                 &lt;tr&gt;
                    &lt;td&gt;Identifier&lt;/td&gt;
                    &lt;td&gt;12345&lt;/td&gt;
                 &lt;/tr&gt;
                 &lt;tr&gt;
                    &lt;td&gt;Date of birth&lt;/td&gt;
                    &lt;td&gt;
                       &lt;span&gt;30 January 1954&lt;/span&gt;
                    &lt;/td&gt;
                 &lt;/tr&gt;
              &lt;/tbody&gt;
           &lt;/table&gt;
        &lt;/div&gt;
     &lt;/text&gt;
     &lt;identifier&gt;
        &lt;system value="http://dmw.levy.com/mrn"&gt;&lt;/system&gt;
        &lt;value value="12345"&gt;&lt;/value&gt;
     &lt;/identifier&gt;
     &lt;name&gt;
        &lt;family value="Vaessen"&gt;&lt;/family&gt;
        &lt;given value="Robert"&gt;&lt;/given&gt;
        &lt;given value="Jozef"&gt;&lt;/given&gt;
     &lt;/name&gt;
     &lt;gender value="male"&gt;&lt;/gender&gt;
     &lt;birthDate value="1954-01-30"&gt;&lt;/birthDate&gt;
  &lt;/Patient&gt;
  </code></pre>
  
  <p>Results for the findPatientsInFamily(String family) method:</p>
  
  <pre><code>Finding patients in family Vaessen
  Cannot find patients
  Failed to parse response from server when performing GET to URL http://fhirtest.uhn.ca/baseDstu3/Patient?family=Vaessen - java.net.SocketTimeoutException: Read timed out
  </code></pre>