transforms/dbRowTranslator.js
/**
 * When provided, the server SHOULD omit unlisted, non-mandatory elements from
 * the resources returned. Elements should be of the form
 * [resource type].[element name] (eg. Patient.id) or [element name] (eg. id)
 * and only root elements in a resource are permitted. If the resource type is
 * omitted, the element should be returned for all resources in the response
 * where it is applicable..
 *
 * Servers are not obliged to return just the requested elements. Servers SHOULD
 * always return mandatory elements whether they are requested or not. Servers
 * SHOULD mark the resources with the tag SUBSETTED to ensure that the incomplete
 * resource is not actually used to overwrite a complete resource.
 *
 * Servers unable to support _elements SHOULD return an error and
 * OperationOutcome resource so clients can re-submit a request omitting the
 * _elements parameter.
 * 
 * @param {object} json The resource json 
 * @param {string[]} elements Array of FHIR Elements
 */
When provided, the server SHOULD omit unlisted, non-mandatory elements from
the resources returned. Elements should be of the form
[resource type].[element name]  or [element name]
and only root elements in a resource are permitted. If the resource type is
omitted, the element should be returned for all resources in the response
where it is applicable

Servers are not obliged to return just the requested elements. Servers SHOULD
always return mandatory elements whether they are requested or not. Servers
SHOULD mark the resources with the tag SUBSETTED to ensure that the incomplete
resource is not actually used to overwrite a complete resource.

Servers unable to support _elements SHOULD return an error and
OperationOutcome resource so clients can re-submit a request omitting the
_elements parameter.

@param {object} json The resource json
@param {string[]} elements Array of FHIR Elements
When provided the server SHOULD omit unlisted non - mandatory elements from the resources returned . Elements should be of the form [ resource type ] . [ element name ] or [ element name ] and only root elements in a resource are permitted . If the resource type is omitted the element should be returned for all resources in the response where it is applicable Servers are not obliged to return just the requested elements . Servers SHOULD always return mandatory elements whether they are requested or not . Servers SHOULD mark the resources with the tag SUBSETTED to ensure that the incomplete resource is not actually used to overwrite a complete resource . Servers unable to support _elements SHOULD return an error and OperationOutcome resource so clients can re - submit a request omitting the _elements parameter . @param { object } json The resource json @param { string [] } elements Array of FHIR Elements
function filterElements(json, elements = [])
{
    if (!elements || !elements.length) {
        return json;
    }
    const out = {};
    const list = [ ...requiredElements, ...elements ];
    for (let element of list) {
        let [type, name] = element.split(/\s*\.\s*/);
        if (!name) {
            name = type;
            type = json.resourceType;
        }
        if (type !== json.resourceType) {
            continue;
        }
        if (json.hasOwnProperty(name)) {
            out[name] = json[name];
        }
    }
    lib.tagResource(out, "SUBSETTED", "http://terminology.hl7.org/CodeSystem/v3-ObservationValue");
    return out;
}
function filterElements ( json , elements = [ ] ) { if ( ! elements || ! elements . length ) { return json ; } const out = { } ; const list = [ ... requiredElements , ... elements ] ; for ( let element of list ) { let [ type , name ] = element . split ( / \s*\.\s* / ) ; if ( ! name ) { name = type ; type = json . resourceType ; } if ( type !== json . resourceType ) { continue ; } if ( json . hasOwnProperty ( name ) ) { out [ name ] = json [ name ] ; } } lib . tagResource ( out , "SUBSETTED" , "http://terminology.hl7.org/CodeSystem/v3-ObservationValue" ) ; return out ; }
When provided, the server SHOULD omit unlisted, non-mandatory elements from
 the resources returned.
When provided the server SHOULD omit unlisted non - mandatory elements from the resources returned .