Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 26 Current »

Introduction

  • This page documents the implementation of the FHIR Location resource (DSTU2) for the OpenMRS FHIR Module

  • The FHIR Location Resource provides information for a physical place where services are provided and resources and participants may be stored, found, contained or accommodated. 
  •  For more information on the FHIR Location resource, please refer http://hl7-fhir.github.io/location.html

Populating the FHIR Location Resource 

Shown below is how attributes of the FHIR Location Resource map to the attributes of the OpenMRS Location object. The left side of the relationship indicates the OpenMRS attribute; the right indicates the FHIR Location resource mapping.

Location
Integer uuid :: n/a - goes in the URL e.g. [base]/Location/[locationId]
String name :: Location.name
String description :: Location.description
String address1 :: Address.line
String address2 :: Address.line
String cityVillage :: Address.city
String stateProvince :: Address.state
String country :: Address.country
String postalCode ::Address.zip
String latitude :: Location.position.longitude
String longitude :: Location.position.latitude
String countyDistrict :: not mapped
String address3 :: Address.line
String address4 :: Address.line
String address6 :: Address.line
String address5 :: Address.line
Location parentLocation :: Location.partOf
Set<Location> childLocations :: not mapped

Example FHIR Location Resource

Shown below is a fleshed out FHIR Location Resource.

FHIR Location Resource
{
  "resourceType": "Location",
  "id": "a846f32f-5401-4d53-871a-68354c22c3f9",
  "name": "South Wing, second floor",
  "description": "Second floor of the Old South Wing, formerly in use by Psychiatry",
  "address": {
    "use": "work",
    "line": [
      "Galapagosweg 91, Building A","line 3", "line 4", "line 5"
    ],
    "city": "Den Burg",
    "postalCode": "9105 PZ",
    "country": "NLD",
    "state":"southern"
  },
  "position": {
    "longitude": -83.6945691,
    "latitude": 42.25475478,
  },
  "partOf": {
     "reference": "Location/c0937d4f-1691-11df-97a5-7038c432aabf"
     "display": "Mosoriot Hospital"
  },
  "status": "active"
}

Available RESTful web services for the Location Resource supported by the API

Read (GET Request)
URLDescription
/ws/fhir/Location/{id}

Returns a FHIR Location resource identified by a Location UUID

Outcomes:

  • Returns a FHIR location resource if the specified Location exists
  • Returns an Operation Outcome resource with a 404 error message if the specified Location does not exist
Search (GET Request)
URLDescription
/ws/fhir/Location?_id={id}

Search locations by given id

/ws/fhir/Location?status={value}

Search locations by given status value whether active or not

/ws/fhir/Location?name={value}
Search locations by name
Delete (DELETE Request)
URLDescription
/ws/fhir/Location/{id}
Will delete a location with given id
Conditional Update(Put Request)
URLDescription
/ws/fhir/Location?[search parameters]

When the server processes this update, it performs a search using its standard search facilities for the resource type, with the goal of resolving a single logical id for this request. The action it takes depends on how many matches are found:

  • No matches: The server performs a create operation
  • One Match: The server performs the update against the matching resource
  • Multiple matches: The server returns a 412 Precondition Failed error indicating the the client's criteria were not selective enough

Ex: /ws/fhir/Location?name=Colombia

PUT(Update Request)
URLDescription
/ws/fhir/Location/{id} or
/ws/fhir/Location/

Send location resource in PUT request body for given URI specified with resource Id will update existing resource while request going

to URI which doesn't have a URI will create a resource.

POST (Post Request)
URLDescription
/ws/fhir/Location
Create a Location Resource for the given representation.
  • No labels