Site Tools


Patient Service

The Patient Service handles basic patient information, storing it in a local database. The service acts as a cache of patient master data stored in other external systems, for instance basic person information stored in the Danish CPR system. The latter functionality is currently purely mocked.

Project status

4S maturity level: Prototyping


Service RESTful API

HL7 FHIR: The Patient Service exposes a RESTful interface for storing and accessing (CRUD operations) HL7 FHIR Patient resources. Definition of FHIR Patient resource can be found here:

Patient Service FHIR API (conformance statement)

FHIR Patient resources are exposed at '/Patient'. Examples:

curl -i -X GET http://<service address>/Patient/

Retrieves a list of patient resources stored by the service.

curl --request POST \
 --url http://localhost:8080/Patient \
 --header 'cache-control: no-cache' \
 --header 'content-type: application/json' \
 --header 'postman-token: 58b02d18-b2ac-1808-264d-d595478277c6' \
 --data '{ "resourceType": "Patient", "identifier": [ { "system": "", "value": "2512489996", "assigner": { "display": "CPR" } } ], "active": true, "name": [ { "family": [ "Berggren" ], "given": [ "Nancy Ann Test" ] } ], "telecom": [ { "system": "phone", "value": "65123456", "use": "work" }, { "system": "email", "value": "", "use": "home" } ], "gender": "female", "birthDate": "1948-12-25", "deceasedBoolean": "false", "address": [ { "use": "home", "line": [ "Testpark Allé 48" ], "city": "Hillerød", "postalCode": "3400" } ]}'

Creates a new patient resource.

Non FHIR: The service also exposes a non-FHIR based interface for including new patients. This interface takes a patient CPR as input and if the patient isn't stored (cached) in the local database of the service a lookup to external systems, like the Danish CPR system, will be performed. The data retrieved from the external systems will be stored locally in a FHIR Patient resource. Communication with external systems is currently purely mocked!

The include patient interface is exposed at '/nofhir/patient/includePatient'. Example:

curl -i -X GET http://localhost:8080/nofhir/patient/includePatient/4444442222

Notice: Two more non-FHIR interface are currently implemented, one for looking up an existing patient based on CPR and one for storing a patient given a FHIR Patient resource in JSON format. These can probably be deprecated and subsumed by the FHIR Patient API.

Source code

Issue Tracking


The Patient Service source code is licensed under the Apache 2.0 license.

4smicroservices/patientservice.txt · Last modified: 2018/12/12 13:27 (external edit)