title: Add extension to R4 Patient
body: <p>How do I add the below to an R4 Patient?</p>
  <pre><code>        &quot;search&quot;: {
              &quot;extension&quot;: [
                  {
                      &quot;url&quot;: &quot;http://hl7.org/fhir/StructureDefinition/match-grade&quot;,
                      &quot;valueCode&quot;: &quot;certain&quot;
                  }
              ],
              &quot;mode&quot;: &quot;match&quot;,
              &quot;score&quot;: 1.0
          }
  </code></pre>
  <p>The objects that were under stu2 and stu3 (I think) have been deprecated.</p>
  <pre><code>DSTU3 and Later
  // Create an example patient
  Patient patient = new Patient();
  patient.addIdentifier().setUse(Identifier.IdentifierUse.OFFICIAL).setSystem(&quot;urn:example&quot;).setValue(&quot;7000135&quot;);
  
  // Create an extension
  Extension ext = new Extension();
  ext.setUrl(&quot;http://example.com/extensions#someext&quot;);
  ext.setValue(new DateTimeType(&quot;2011-01-02T11:13:15&quot;));
  
  // Add the extension to the resource
  patient.addExtension(ext);
  </code></pre>
  <p>Full &quot;response&quot; json from patient match below (sample data, not real data !! )</p>
  <pre><code>{
      &quot;resourceType&quot;: &quot;Bundle&quot;,
      &quot;id&quot;: &quot;94897c77-4120-482f-bdb4-4c8b9a71ade1&quot;,
      &quot;meta&quot;: {
          &quot;versionId&quot;: &quot;1&quot;,
          &quot;lastUpdated&quot;: &quot;2020-11-24T08:45:49.445-05:00&quot;
      },
      &quot;type&quot;: &quot;searchset&quot;,
      &quot;total&quot;: 1,
      &quot;link&quot;: [
          {
              &quot;relation&quot;: &quot;self&quot;,
              &quot;url&quot;: &quot;http://wildfhir4.aegis.net/fhir4-0-0/Patient/$match?&quot;
          }
      ],
      &quot;entry&quot;: [
          {
              &quot;fullUrl&quot;: &quot;http://wildfhir4.aegis.net/fhir4-0-0/Patient/9126db824dcf4d5ab3f68e63bd5eaced&quot;,
              &quot;resource&quot;: {
                  &quot;resourceType&quot;: &quot;Patient&quot;,
                  &quot;id&quot;: &quot;9126db824dcf4d5ab3f68e63bd5eaced&quot;,
                  &quot;meta&quot;: {
                      &quot;versionId&quot;: &quot;1&quot;,
                      &quot;lastUpdated&quot;: &quot;2020-09-03T09:03:28.193-04:00&quot;,
                      &quot;tag&quot;: [
                          {
                              &quot;system&quot;: &quot;http://terminology.hl7.org/CodeSystem/v3-ActReason&quot;,
                              &quot;code&quot;: &quot;HTEST&quot;,
                              &quot;display&quot;: &quot;test health data&quot;
                          }
                      ]
                  },
                  &quot;text&quot;: {
                      &quot;status&quot;: &quot;generated&quot;,
                      &quot;div&quot;: &quot;&lt;div xmlns=\&quot;http://www.w3.org/1999/xhtml\&quot;&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Name&lt;/td&gt;&lt;td&gt;Peter James                             \n              &lt;b&gt;Chalmers&lt;/b&gt; (&amp;quot;Jim&amp;quot;)                        \n            &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Address&lt;/td&gt;&lt;td&gt;534 Erewhon, Pleasantville, Vic, 3999&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Contacts&lt;/td&gt;&lt;td&gt;Home: unknown. Work: (03) 5555 6473&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Id&lt;/td&gt;&lt;td&gt;MRN: 12345 (Acme Healthcare)&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&quot;
                  },
                  &quot;identifier&quot;: [
                      {
                          &quot;use&quot;: &quot;usual&quot;,
                          &quot;type&quot;: {
                              &quot;coding&quot;: [
                                  {
                                      &quot;system&quot;: &quot;http://terminology.hl7.org/CodeSystem/v2-0203&quot;,
                                      &quot;code&quot;: &quot;MR&quot;
                                  }
                              ]
                          },
                          &quot;system&quot;: &quot;urn:oid:1.2.36.146.595.217.0.1&quot;,
                          &quot;value&quot;: &quot;12345&quot;,
                          &quot;period&quot;: {
                              &quot;start&quot;: &quot;2001-05-06&quot;
                          },
                          &quot;assigner&quot;: {
                              &quot;display&quot;: &quot;Acme Healthcare&quot;
                          }
                      }
                  ],
                  &quot;active&quot;: true,
                  &quot;name&quot;: [
                      {
                          &quot;use&quot;: &quot;official&quot;,
                          &quot;family&quot;: &quot;Chalmers&quot;,
                          &quot;given&quot;: [
                              &quot;Peter&quot;,
                              &quot;James&quot;
                          ]
                      },
                      {
                          &quot;use&quot;: &quot;usual&quot;,
                          &quot;given&quot;: [
                              &quot;Jim&quot;
                          ]
                      },
                      {
                          &quot;use&quot;: &quot;maiden&quot;,
                          &quot;family&quot;: &quot;Windsor&quot;,
                          &quot;given&quot;: [
                              &quot;Peter&quot;,
                              &quot;James&quot;
                          ],
                          &quot;period&quot;: {
                              &quot;end&quot;: &quot;2002&quot;
                          }
                      }
                  ],
                  &quot;telecom&quot;: [
                      {
                          &quot;use&quot;: &quot;home&quot;
                      },
                      {
                          &quot;system&quot;: &quot;phone&quot;,
                          &quot;value&quot;: &quot;(03) 5555 6473&quot;,
                          &quot;use&quot;: &quot;work&quot;,
                          &quot;rank&quot;: 1
                      },
                      {
                          &quot;system&quot;: &quot;phone&quot;,
                          &quot;value&quot;: &quot;(03) 3410 5613&quot;,
                          &quot;use&quot;: &quot;mobile&quot;,
                          &quot;rank&quot;: 2
                      },
                      {
                          &quot;system&quot;: &quot;phone&quot;,
                          &quot;value&quot;: &quot;(03) 5555 8834&quot;,
                          &quot;use&quot;: &quot;old&quot;,
                          &quot;period&quot;: {
                              &quot;end&quot;: &quot;2014&quot;
                          }
                      }
                  ],
                  &quot;gender&quot;: &quot;male&quot;,
                  &quot;birthDate&quot;: &quot;1974-12-25&quot;,
                  &quot;_birthDate&quot;: {
                      &quot;extension&quot;: [
                          {
                              &quot;url&quot;: &quot;http://hl7.org/fhir/StructureDefinition/patient-birthTime&quot;,
                              &quot;valueDateTime&quot;: &quot;1974-12-25T14:35:45-05:00&quot;
                          }
                      ]
                  },
                  &quot;deceasedBoolean&quot;: false,
                  &quot;address&quot;: [
                      {
                          &quot;use&quot;: &quot;home&quot;,
                          &quot;type&quot;: &quot;both&quot;,
                          &quot;text&quot;: &quot;534 Erewhon St PeasantVille, Rainbow, Vic  3999&quot;,
                          &quot;line&quot;: [
                              &quot;534 Erewhon St&quot;
                          ],
                          &quot;city&quot;: &quot;PleasantVille&quot;,
                          &quot;district&quot;: &quot;Rainbow&quot;,
                          &quot;state&quot;: &quot;Vic&quot;,
                          &quot;postalCode&quot;: &quot;3999&quot;,
                          &quot;period&quot;: {
                              &quot;start&quot;: &quot;1974-12-25&quot;
                          }
                      }
                  ],
                  &quot;contact&quot;: [
                      {
                          &quot;relationship&quot;: [
                              {
                                  &quot;coding&quot;: [
                                      {
                                          &quot;system&quot;: &quot;http://terminology.hl7.org/CodeSystem/v2-0131&quot;,
                                          &quot;code&quot;: &quot;N&quot;
                                      }
                                  ]
                              }
                          ],
                          &quot;name&quot;: {
                              &quot;family&quot;: &quot;du Marché&quot;,
                              &quot;_family&quot;: {
                                  &quot;extension&quot;: [
                                      {
                                          &quot;url&quot;: &quot;http://hl7.org/fhir/StructureDefinition/humanname-own-prefix&quot;,
                                          &quot;valueString&quot;: &quot;VV&quot;
                                      }
                                  ]
                              },
                              &quot;given&quot;: [
                                  &quot;Bénédicte&quot;
                              ]
                          },
                          &quot;telecom&quot;: [
                              {
                                  &quot;system&quot;: &quot;phone&quot;,
                                  &quot;value&quot;: &quot;+33 (237) 998327&quot;
                              }
                          ],
                          &quot;address&quot;: {
                              &quot;use&quot;: &quot;home&quot;,
                              &quot;type&quot;: &quot;both&quot;,
                              &quot;line&quot;: [
                                  &quot;534 Erewhon St&quot;
                              ],
                              &quot;city&quot;: &quot;PleasantVille&quot;,
                              &quot;district&quot;: &quot;Rainbow&quot;,
                              &quot;state&quot;: &quot;Vic&quot;,
                              &quot;postalCode&quot;: &quot;3999&quot;,
                              &quot;period&quot;: {
                                  &quot;start&quot;: &quot;1974-12-25&quot;
                              }
                          },
                          &quot;gender&quot;: &quot;female&quot;,
                          &quot;period&quot;: {
                              &quot;start&quot;: &quot;2012&quot;
                          }
                      }
                  ],
                  &quot;managingOrganization&quot;: {
                      &quot;reference&quot;: &quot;Organization/1&quot;
                  }
              },
              &quot;search&quot;: {
                  &quot;extension&quot;: [
                      {
                          &quot;url&quot;: &quot;http://hl7.org/fhir/StructureDefinition/match-grade&quot;,
                          &quot;valueCode&quot;: &quot;certain&quot;
                      }
                  ],
                  &quot;mode&quot;: &quot;match&quot;,
                  &quot;score&quot;: 1.0
              }
          }
      ]
  }
  </code></pre>
  <p>APPEND: I found this:</p>
  <p><a href="https://hapifhir.io/hapi-fhir/apidocs/hapi-fhir-structures-r4/org/hl7/fhir/r4/model/codesystems/MatchGrade.html" rel="nofollow noreferrer">https://hapifhir.io/hapi-fhir/apidocs/hapi-fhir-structures-r4/org/hl7/fhir/r4/model/codesystems/MatchGrade.html</a></p>