@naitik, sharing a sample mapping file for Person (relatively simple resource). Some highlights:
- You will notice it is the same as the FHIR schema (simplified by removing not needed attributes).
- There are a few additional attributes:
a) op - transformation to be performed.
b) source / value - the attribute of input data or an expression.
c) codeMapping - mappings of input codes onto corresponding FHIR codes.
- op can be one of the following:
a) value - another attribute called “value” gives the hard code value. This is useful for certain constants.
b) “=” - simple assignment (take the value of the source as it is)
c) “exp” - Evaluate given expression against the input data.
d) “template” - replace template varaibles with the value in the input data.
e) “script” - execute a script (rule) against input data.
f) dateFormat - requires additional input for input datec format and outpur date format.
The rest is self-explanatory. We built a UI tool for creating mapping with the right side being the FHIR resources, the left side being the input data.
{
“orgName”: “ABCCorp”,
“flowsByName”: {
“Person”: {
“name”: “Person”,
“associatedObj”: {
“resourceName”: “Person”,
“name”: “Person”
},
“activities”: [
{
“name”: “id”,
“type”: “string”,
“description”: “The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.”,
“value”: “$UUID”,
“min”: 0,
“max”: “1”,
“lvl”: 0,
“qualifiedName”: “id”,
“op”: “value”
},
{
“name”: “use”,
“description”: “The purpose of this identifier.”,
“type”: “string”,
“value”: “usual”,
“enum”: [
“usual”,
“official”,
“temp”,
“secondary”,
“old”
],
“isEnum”: true,
“lvl”: 1,
“qualifiedName”: “identifier[].use”,
“op”: “value”
},
{
“name”: “type”,
“type”: “string”,
“description”: “A coded type for the identifier that can be used to determine which identifier to use for a specific purpose.”,
“codingSystem”: “http://ABCCorp.com/CodeSystem/v1-0101”,
“isEnum”: true,
“isCodableConcept”: true,
“lvl”: 1,
“qualifiedName”: “identifier[].type”,
“op”: “=”
},
{
“name”: “system”,
“description”: “Establishes the namespace for the value - that is, a URL that describes a set values that are unique.”,
“type”: “string”,
“value”: “$orgUUID”,
“lvl”: 1,
“qualifiedName”: “identifier[].system”,
“op”: “value”
},
{
“name”: “value”,
“type”: “string”,
“description”: “The portion of the identifier typically relevant to the user and which is unique within the context of the system.”,
“lvl”: 1,
“qualifiedName”: “identifier[].value”,
“op”: “=”,
“source”: “person_id”
},
{
“name”: “family”,
“description”: “The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.”,
“type”: “string”,
“lvl”: 1,
“qualifiedName”: “name[].family”,
“op”: “=”,
“source”: “last_name”
},
{
“name”: “given”,
“description”: “Given name.”,
“type”: “string”,
“isArray”: true,
“index”: 0,
“lvl”: 1,
“qualifiedName”: “name[].given[]”,
“op”: “concate”,
“source”: “first_name + middle_name”
},
{
“name”: “prefix”,
“description”: “Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name.”,
“type”: “string”,
“isArray”: true,
“index”: 0,
“lvl”: 1,
“qualifiedName”: “name[].prefix[]”,
“op”: “=”,
“source”: “prefix_name”
},
{
“name”: “suffix”,
“description”: “Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name.”,
“type”: “string”,
“isArray”: true,
“index”: 0,
“lvl”: 1,
“qualifiedName”: “name[].suffix[]”,
“op”: “=”,
“source”: “suffix_name”
},
{
“name”: “gender”,
“description”: “Administrative Gender.”,
“type”: “string”,
“enum”: [
“male”,
“female”,
“other”,
“unknown”
],
“isEnum”: true,
“min”: 0,
“max”: “1”,
“lvl”: 0,
“qualifiedName”: “gender”,
“op”: “=”,
“source”: “sex”
},
{
“name”: “birthDate”,
“type”: “date”,
“description”: “The birth date for the person.”,
“min”: 0,
“max”: “1”,
“lvl”: 0,
“qualifiedName”: “birthDate”,
“op”: “=”
},
{
“name”: “line”,
“description”: “This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information.”,
“type”: “string”,
“isArray”: true,
“index”: 0,
“lvl”: 1,
“qualifiedName”: “address[].line[]”,
“op”: “concate”,
“source”: “address_line_1 + address_line_2”
},
{
“name”: “city”,
“description”: “The name of the city, town, suburb, village or other community or delivery center.”,
“type”: “string”,
“lvl”: 1,
“qualifiedName”: “address[].city”,
“op”: “=”,
“source”: “city”
},
{
“name”: “state”,
“description”: “Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (e.g. US 2 letter state codes).”,
“type”: “string”,
“lvl”: 1,
“qualifiedName”: “address[].state”,
“op”: “=”,
“source”: “state”
},
{
“name”: “postalCode”,
“description”: “A postal code designating a region defined by the postal service.”,
“type”: “string”,
“lvl”: 1,
“qualifiedName”: “address[].postalCode”,
“op”: “=”,
“source”: “zip”
},
{
“name”: “active”,
“type”: “boolean”,
“description”: “Whether this person’s record is in active use.”,
“value”: true,
“min”: 0,
“max”: “1”,
“lvl”: 0,
“qualifiedName”: “active”,
“op”: “value”
},
{
“name”: “notes”,
“description”: “Custom extension for storing information as text.”,
“isExtension”: true,
“type”: “string”,
“lvl”: 0,
“qualifiedName”: “notes”,
“op”: “template”,
“source” : “{{{}}}”
}
],
“selectedActivityName”: “identifier[].value”,
}
}
}