Skip to content
nditada edited this page Sep 18, 2014 · 22 revisions

You can access your collection's data through Resource Map's IHE CSD API endpoint.

Specs

http://www.ihe.net/uploadedFiles/Documents/ITI/IHE_ITI_Suppl_CSD_Rev1%201_TI_2013-09-20.pdf

CSD Actor

When it comes to CSD, Resource Map plays the role of a Care Services Directory (see "35.1 CSD Actors, Transactions, and Content Modules" in the specs).

A CSD Care Services Directory actor has only one responsibility: given a timestamp, it returns all the entities that have been created, modified or deleted since that moment (see "3.74.4.1 Query for Updated Services Request" in the specs).

There are four different kinds of entities that a Care Services Directory may provide: organizations, providers, facilities and services. In particular, given Resource Map works as an OHIE Facility Registry, it only provides facilities.

Endpoint

For a comprehensive description of how you should query a Care Services Directory see "3.74.4.1.2 Message Semantics" in the specs). As you can find there, in order to query a directory you're supposed to POST a SOAP message to a known URI.

In Resource Map, the URI depends on the collection you intend to query. For instance, if the collection you want to expose through CSD has id=1071, it results in the following Care Services Directory endpoint URI:

http://resourcemap.instedd.org/plugin/csd_api/collections/1071/csd_api/get_directory_modifications

Configuration

CSD specifies a fixed facility schema in "Y.2 CSD Schema" whereas, as you may already know, Resource Map lets you design your own schema for your collections. As a consequence, if you want to expose your collection through CSD, you'll have to tell Resource Map how to map your custom schema to the one expected by the CSD profile.

You can configure that mapping by adding metadata to your collection's fields. Go to your collection's Layer tab and open a field to edit it, then expand the Advanced section. You should see something similar to the image below:

The rest of this document explains how you can map your collection's fields to the schema defined by CSD by adding metadata Key-Value pairs through this interface.

Mappings

The table below shows how you should set up Key-Value pairs to have them exposed to their CSD counterparts. You can take a look at the list of CSD fields by reading "Table Y.1-2: Facility Attributes" from the specs.

CSD Field Cardinality RM Field type RM Field metadata Other considerations
oid 1..1 Identifier "CSDType": "facilityOid"
otherId 0..n Identifier RM maps all identifiers other than the oid to this attribute
codedType 1..n Select One "CSDType": "codedType"
"codingSchema": See "Mapping coded types"
primaryName 1..1 Built-in Name RM maps its built-in Name field to this CSD field.
otherName 0..n Text "CSDType": "otherName"
address 0..n "CSDAddress": See "Mapping addresses" An address is a composite of many fields. See section "Mapping addresses".
"CSDChildOf": "CSDFacility"
contact 0..n "CSDType": "contact" A contact is a composite of many fields. See section "Mapping contacts".
"CSDCode": See "Mapping contacts"
geoCode 0..1 Built-in Location RM maps its built-in Lat and Lon fields to this CSD element.
language 0..n Select One "CSDChildOf": "CSDFacility"
"CSDLanguage": ""
"codingSchema": "BCP 47"
contactPoint 0..n See section "Mapping contact points."
organizations 1..n "CSDOrganization": "" See section "Mapping organizations."
operatingHours 0..n "CSDChildOf": "CSDFacility" See section "Mapping operating hours."
"CSDOperatingHours": ""
record/@created 1..1 RM maps its internal site creation date timestamp to this CSD attribute.
record/@updated 1..1 RM maps its internal site update date timestamp to this CSD attribute.
record/@status 1..1 RM currently doesn't support this field and always sends 'Active' for compliance.

Mapping coded types

codingSchema is an attribute of codedType, which refers to the source of possible values for a codedType field. For example, if you have a Select One field in RM where you choose from a list of country codes you would probably want to set its as: "CSDType":"codedType, "codingSchema":"ISO 3166-1".