Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
titleCreation of a patient (Java) using defined operation using the HAPI FHIR client framework
	    Parameters in = new Parameters();
	    in.addParameter().setName("crn").setValue(new Identifier().setSystem("urn:oid:1.2.208.176.1.2").setValue("2810887020"));
	    in.addParameter().setName("managingOrganization").setValue(new Reference()
	    	    .setIdentifier(new Identifier().setSystem("urn:oid:1.2.208.176.1.1").setValue("260481000016005")));
	    in.addParameter().setName("policy").setValue(new UriType().setValue("https://danskelove.dk/sundhedsloven"));

	    Parameters result = client.operation().onType(Patient.class).named("createPatientFromPersoncreatePatient")
	    	    .withParameters(in).execute();

...

Code Block
languagexml
titlePatient create using operation
POST /Patient/$createPatient
Content-Type: text/xml; extended-operation-type
Accept: */*
Host: localhost:8080
accept-encoding: gzip, deflate
content-length: 689
<Parameters
    xmlns="http://hl7.org/fhir">
    <parameter>
        <name value="crn" />
        <valueIdentifier>
            <system value="urn:oid:1.2.208.176.1.2" />
            <value value="2810887020" />
        </valueIdentifier>
    </parameter>
    <parameter>
        <name value="policy" />
        <valueUri value="https://danskelove.dk/sundhedsloven" />
    </parameter>
    <parameter>
        <name value="managingOrganization" />
        <valueReference>
            <identifier>
                <system value="urn:oid:1.2.208.176.1.1" />
                <value value="275891000016005" />
            </identifier>
        </valueReference>
    </parameter>
</Parameters>

Example HTTP response

...

:

Code Block
languagexml
titleServer Intended HTTP server response
HTTP/1.1 200
status: 200
Date: Wed, 20 Feb 2019 09:00:35 GMT
X-Powered-By: Trifork
Content-Type: application/fhir+xml;charset=utf-8
Content-Encoding: gzip
Transfer-Encoding: chunked
Server: Jetty(9.4.14.v20181114)
<Parameters
    xmlns="http://hl7.org/fhir">
    <parameter>
        <resource>
            <Patient
                xmlns="http://hl7.org/fhir">
                				<id value="9952"/>
                				<meta>
                    <versionId value="1"/>
                    <lastUpdated value="2019-0203-19T1429T11:5422:2634.894053+01:00"/>
                    <profile value="http://triforkehealth.sundhed.dk/fhir/StructureDefinition/dk-tmehealth-patient"/>
                </meta>
                <text>
                    <status value="generated"/>
                    <div
                        xmlns="http://www.w3.org/1999/xhtml">
                        <div class="hapiHeaderText">Given Test 1615618386 
                            <b>FAMILY TEST 1592826680 </b>
                        </div>
                        <table class="hapiPropertyTable">
                            <tbody>
                                <tr>
                                    <td>Identifier</td>
                                    <td>0107729996</td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </...</text>
                <identifier>
                    <system value="urn:oid:1.2.208.176.1.2"/>
                    <value value="0107729996"/>
                </identifier>
                <name>
                    <family value="Family Test 1592826680"/>
                    <given value="Given Test 1615618386"/>
                </name>
                <managingOrganization>
                    <identifier>
                        <system value="urn:oid:1.2.208.176.1.1"/>
                        <value value="275891000016005"/>
                    </identifier>
                </managingOrganization>
            </Patient>
        </resource>
    </parameter>
</Parameters>

Example HTTP response as intended:

Code Block
languagexml
titleIntended HTTP server response
HTTP/1.1 200
status: 200
Date: Wed, 20 Feb 2019 09:00:35 GMT
X-Powered-By: Trifork
Content-Type: application/fhir+xml;charset=utf-8
Content-Encoding: gzip
Transfer-Encoding: chunked
Server: Jetty(9.4.14.v20181114)
<Parameters
    xmlns="http://hl7.org/fhir">
    <parameter>
        <resource>
            <Patient
                xmlns="http://hl7.org/fhir">
				<id value="9952"/>
                <identifier>
                    <system value="urn:oid:1.2.208.176.1.2"/>
                    <value value="2810887020"/>
                </identifier>
                <name>
                    <family value="Møller"/>
                    <given value="Anne"/>
                    <given value="Holm"/>
                </name>
                <birthDate value="1988-10-28"/>
                <address>
                    <extension url="http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-municipality-code">
                        <valueCoding>
                            <system value="urn:oid:1.2.208.176.8.1.100"/>
                            <code value="370"/>
                            <display value="Næstved"/>
                        </valueCoding>
                    </extension>
                    <extension<use urlvalue="http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-regional-subdivision-code">"home"/>
                    <type value="postal"/>
   <valueCoding>                 <line value="Bjergagervej 110"/>
         <system value="urn:iso:std:iso:3166-2:DK"/>           <city value="Karrebæksminde"/>
                    <code<postalCode value="0854736"/>
                    <country value="DK"/>
      <display value="Region Sjælland"/>          </address>
                <generalPractitioner>
   </valueCoding>                 <identifier>
   </extension>                     <line<system value="Bjergagervej 110urn:oid:1.2.208.176.1.4"/>
                       <city <value value="Karrebæksminde12345"/>
                    <postalCode value="4736"/></identifier>
                </address>generalPractitioner>
                <managingOrganization>
                    <identifier>
                        <system value="urn:oid:1.2.208.176.1.1.2"/>
                        <value value="260481000016005"/>
                    </identifier>
                    <display value="Lungemedicinsk Ambulatorium"/>
                </managingOrganization>
            </Patient>
        </resource>
    </parameter>
</Parameters>

...