Introduction

The Patient Registry Tool

Pixm Connector


Prerequisites

  • Java 11 with maven.
  • WildFly 18.

    Build project locally

After cloning this repository to your local installation launch

    > mvn clean install

from the project root directory.

The artifact pixm_fhir_server.war will be created in target/ directory.


Deploy on WildFly server

After building the project through Maven, the artifact created just has to be added to your local WildFly installation in the folder

    {$wildfly.home}/standalone/deployments

Request a Patient on a specific Target Identifier

Once the project deployed on your WildFly, you can now call it to request a cross Referenced Patient in the Patient Registry.

Parameters allowed are :

  • The Patient Identifier and the Target System attributed to this identifier
  • The Target System you want the cross reference from.
  • The format returned.

Cardinality for these parameters will be described in each profile since it’s the main difference between each.

IHE Profile

The URL to call is

    {wildfly18.address}/pixm_fhir_server/fhir_ihe/Patient/$ihe-pix
Parameter name Cardinality Parameter Type Description
sourceIdentifier 1..1 Token The Patient identifier search parameter that will be used by the Patient Identifier Cross-reference Manager to find cross matching identifiers associated with the Patient Resource
targetSystem 0..* uri The target Patient Identifier Assigning Authority from which the returned identifiers should be selected.
_format 0..1 mime-type The requested format of the response. Accepted values : JSON and XML

CH Profile

The URL to call is

    {wildfly18.address}/pixm_fhir_server/fhir_ch/Patient/$ihe-pix
Parameter name Cardinality Parameter Type Description
sourceIdentifier 1..1 Token The Patient identifier search parameter that will be used by the Patient Identifier Cross-reference Manager to find cross matching identifiers associated with the Patient Resource
targetSystem 1..2 uri The target Patient Identifier Assigning Authority from which the returned identifiers should be selected.
_format 0..1 mime-type The requested format of the response. Accepted values : JSON and XML

For example : Given the Patient with the ID 69420 in the Target System 1.3.6.1.4.1.21367.13.20.3000 And you want the cross referenced patient in the target system 1.3.6.1.4.1.21367.13.20.1000

The corresponding url will be :

    {wildfly18.address}/pixm_fhir_server/fhir_ihe/Patient/$ihe-pix?sourceIdentifier=urn:oid:1.3.6.1.4.1.21367.13.20.3000|69420&targetSystem=urn:oid:1.3.6.1.4.1.21367.13.20.1000

Error returned

Malformed requests can cause different types of error, here is a quick overview of how to troubleshoot them :

  • An error 400 Bad Request is returned when the source domain given within the source identifier parameter is not recognized by the Patient Registry as an asigning authority. In the case of our request above, the value “urn:oid:1.3.6.1.4.1.21367.13.20.3000” is not a valid source domain able to register Patients

Common mistakes with the source domain include :

  • Forgetting the namespace in front of the adress (urn:oid:)
  • Malformed source domain. The source domain can have the form of an url
    sourceIdentifier=https://your.domain|id
    

    or of an adress, which must follows the pattern x.x.x.x.x.x.x.x.x.x

    sourceIdentifier=urn:oid:x.x.x.x.x.x.x.x.x.x|id
    

  • An error 403 Forbidden is returned when a target domain given in the target system parameter is not recognized by the Patient Registry. In the case of our request above, the value “urn:oid:1.3.6.1.4.1.21367.13.20.1000” is not recognized as a valid target domain containing Patients.

Common mistakes with the target system are the same as the aformentioned error 400 since the target system and the source domain have the same representation.


  • An error 404 Not Found is returned when the patient identifier given within the source identifier parameter is not recognized by the Patient registry. In the case of our request above, the value “69420” is not a valid Identifier linked to an existing Patient.

PIXm Feed

The simulator PIXm has been upgraded. It’s now able to perform feed on Xreference Manager for CH profiles. Two methods are available for Swiss implementation.

  • Create : PIXm Simulator is able to handle create query. Using Bundle and Patient FHIR resources. (See documentation in the project for more information)
  • Delete : PIXm Simulatir is able to handle delete query. Using Bundle and Patient FHIR resources. (See documentation in the project for more information)

CREATE METHOD :


Send the following REST Request

Bundle Resource :

POST : {serverAdress}/ch_fhir/Bundle/

With a prefilled body as following for Bundle:

{
    "resourceType" : "Bundle",
    "id" : "BundlePIXmFeed",
    "meta" : {
      "profile" : [
        "http://fhir.ch/ig/ch-epr-mhealth/StructureDefinition/ch-pixm-bundle"
      ]
    },
    "type" : "message",
    "entry" : [
      {
        "fullUrl" : "http://example.com/fhir/MessageHeader/1",
        "resource" : {
          "resourceType" : "MessageHeader",
          "id" : "1",
          "text" : {
            "status" : "generated",
            "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Generated Narrative</b></p><p><b>event</b>: <code>urn:ihe:iti:pmir:2019:patient-feed</code></p><h3>Destinations</h3><table class=\"grid\"><tr><td>-</td><td><b>Endpoint</b></td></tr><tr><td>*</td><td><a href=\"http://example.com/patientEndpoint\">http://example.com/patientEndpoint</a></td></tr></table><h3>Sources</h3><table class=\"grid\"><tr><td>-</td><td><b>Endpoint</b></td></tr><tr><td>*</td><td><a href=\"http://example.com/patientSource\">http://example.com/patientSource</a></td></tr></table><p><b>focus</b>: <a href=\"#Bundle_abc\">See above (Bundle/abc)</a></p></div>"
          },
          "eventUri" : "urn:ihe:iti:pmir:2019:patient-feed",
          "destination" : [
            {
              "endpoint" : "http://example.com/patientEndpoint"
            }
          ],
          "source" : {
            "endpoint" : "http://example.com/patientSource"
          },
          "focus" : [
            {
              "reference" : "Bundle/abc"
            }
          ]
        }
      },
      {
        "fullUrl" : "http://example.com/fhir/Bundle/abc",
        "resource" : {
          "resourceType" : "Bundle",
          "id" : "abc",
          "type" : "history",
          "entry" : [
            {
              "fullUrl" : "http://example.com/fhir/Patient/PatientPIXmFeed",
              "resource" : {
                "resourceType" : "Patient",
                "id" : "PatientPIXmFeed",
                "text" : {
                  "status" : "generated",
                  "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Generated Narrative</b></p><p><b>id</b>: PatientPIXmFeed</p><p><b>meta</b>: </p><p><b>identifier</b>: Medical record number = 8734</p><p><b>name</b>: Franz Muster , Muster </p><p><b>gender</b>: male</p><p><b>birthDate</b>: 1995-01-27</p></div>"
                },
                "contained" : [
                  {
                    "resourceType" : "Organization",
                    "id" : "org1",
                    "identifier" : [
                      {
                        "system" : "${system}",
                        "value" : "${value}"
                      }
                    ],
                    "address" : [
                      {
                        "use" : "work",
                        "line" : [
                          "Doktorgasse",
                          "2"
                        ],
                        "city" : "Musterhausen",
                        "postalCode" : "8888",
                        "country" : "CH"
                      }
                    ]
                  }
                ],
                "identifier" : [
                  {
                    "type" : {
                      "coding" : [
                        {
                          "system" : "http://terminology.hl7.org/CodeSystem/v2-0203",
                          "code" : "MR"
                        }
                      ]
                    },
                    "system" : "${#system}",
                    "value" : "${#value}" 
                  }
                ],
                "name" : [
                  {
                    "family" : "${#name.family}",
                    "given" : [
                      "${#name.given}"
                    ]
                  },
                  {
                    "family" : "${#name.family}",
                    "_family" : {
                      "extension" : [
                        {
                          "url" : "http://hl7.org/fhir/StructureDefinition/iso21090-EN-qualifier",
                          "valueCode" : "BR"
                        }
                      ]
                    }
                  }
                ],
                "gender" : "${#gender}", 
                "birthDate" : "${#birthDate}",
                "managingOrganization" : {
                  "reference" : "#org1"
                }
              },
              "request" : {
                "method" : "POST", 
                "url" : "Patient"
              },
              "response" : {
                "status" : "200"
              }
            }
          ]
        }
      }
    ]
  }

CREATE METHOD :


Patient Resource :

Send the following REST Request

POST : {serverAdress}/ch_fhir/Patient/

With a prefilled body as following :

{
    "resource" : {
    "resourceType" : "Patient",
    "id" : "PatientPIXmFeed",
    "text" : {
      "status" : "generated",
      "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Generated Narrative</b></p><p><b>id</b>: PatientPIXmFeed</p><p><b>meta</b>: </p><p><b>identifier</b>: Medical record number = 8734</p><p><b>name</b>: Franz Muster , Muster </p><p><b>gender</b>: male</p><p><b>birthDate</b>: 1995-01-27</p></div>"
    },
    "contained" : [
      {
        "resourceType" : "Organization",
        "id" : "org1",
        "identifier" : [
          {
            "system" : "${system}",
            "value" : "${value}"
          }
        ],
        "address" : [
          {
            "use" : "work",
            "line" : [
              "Doktorgasse",
              "2"
            ],
            "city" : "Musterhausen",
            "postalCode" : "8888",
            "country" : "CH"
          }
        ]
      }
    ],
    "identifier" : [
      {
        "type" : {
          "coding" : [
            {
              "system" : "http://terminology.hl7.org/CodeSystem/v2-0203",
              "code" : "MR"
            }
          ]
        },
        "system" : "${#system}",
        "value" : "${#value}" 
      }
    ],
    "name" : [
      {
        "family" : "${#name.family}",
        "given" : [
          "${#name.given}"
        ]
      },
      {
        "family" : "${#name.family}",
        "_family" : {
          "extension" : [
            {
              "url" : "http://hl7.org/fhir/StructureDefinition/iso21090-EN-qualifier",
              "valueCode" : "BR"
            }
          ]
        }
      }
    ],
    "gender" : "${#gender}", 
    "birthDate" : "${#birthDate}",
    "managingOrganization" : {
      "reference" : "#org1"
}
  

These parameters are mandatory in CREATE method

  • name.given
  • name.family
  • birthdate
  • gender

DELETE METHOD


Patient Resource :

Send the following REST Request

Delete : {serverAdress}/ch_fhir/Patient/{uuid}

Bundle Resource :

Send the following REST Request

DELETE : {serverAdress}/Bundle/{id}

Same body as a create except :

  • request method must be “delete” at the end :
    		
                "request" : {
                  "method" : "DELETE", 
                  "url" : "Patient"
                },
    
  • Mandatory field to fill in case of DELETE method :
    • uuid