src/components/DisplayBox/DisplayBox.js
/**
   * For SMART links, modify the link URLs as this component processes them according to two scenarios:
   * 1 - Secured: Retrieve a launch context for the link and append a launch and iss parameter for use against secured endpoints
   * 2 - Open: Append a fhirServiceUrl and patientId parameter to the link for use against open endpoints
   * @param {*} card - Card object to process the links for
   */
For SMART links, modify the link URLs as this component processes them according to two scenarios:
1 - Secured: Retrieve a launch context for the link and append a launch and iss parameter for use against secured endpoints
2 - Open: Append a fhirServiceUrl and patientId parameter to the link for use against open endpoints
@param {*} card - Card object to process the links for
For SMART links modify the link URLs as this component processes them according to two scenarios : 1 - Secured : Retrieve a launch context for the link and append a launch and iss parameter for use against secured endpoints 2 - Open : Append a fhirServiceUrl and patientId parameter to the link for use against open endpoints @param { * } card - Card object to process the links for
modifySmartLaunchUrls(card) {
    if (!this.props.isDemoCard) {
      return card.links.map((link) => {
        let linkCopy = Object.assign({}, link);
        if (link.type === 'smart' && (this.props.fhirAccessToken || this.props.ehrLaunch) && !this.state.smartLink) {
          this.props.retrieveLaunchContext(
            linkCopy, this.props.fhirAccessToken,
            this.props.patientId, this.props.fhirServerUrl, this.props.fhirVersion
          ).then((result) => {
            linkCopy = result;
            return linkCopy;
          });
        } else if (link.type === 'smart') {
          if (link.url.indexOf('?') < 0) {
            linkCopy.url += '?';
          } else {
            linkCopy.url += '&';
          }
        }
        return linkCopy;
      });
    }
    return undefined;
  }
modifySmartLaunchUrls ( card ) { if ( ! this . props . isDemoCard ) { return card . links . map ( ( link ) => { let linkCopy = Object . assign ( { } , link ) ; if ( link . type === 'smart' && ( this . props . fhirAccessToken || this . props . ehrLaunch ) && ! this . state . smartLink ) { this . props . retrieveLaunchContext ( linkCopy , this . props . fhirAccessToken , this . props . patientId , this . props . fhirServerUrl , this . props . fhirVersion ) . then ( ( result ) => { linkCopy = result ; return linkCopy ; } ) ; } else if ( link . type === 'smart' ) { if ( link . url . indexOf ( '?' ) < 0 ) { linkCopy . url += '?' ; } else { linkCopy . url += '&' ; } } return linkCopy ; } ) ; } return undefined ; }
For SMART links, modify the link URLs as this component processes them according to two scenarios:
 1 - Secured: Retrieve a launch context for the link and append a launch and iss parameter for use against secured endpoints
 2 - Open: Append a fhirServiceUrl and patientId parameter to the link for use against open endpoints
 @param {*} card - Card object to process the links for
For SMART links modify the link URLs as this component processes them according to two scenarios : 1 - Secured : Retrieve a launch context for the link and append a launch and iss parameter for use against secured endpoints 2 - Open : Append a fhirServiceUrl and patientId parameter to the link for use against open endpoints @param { * } card - Card object to process the links for
//linkCopy.url += `fhirServiceUrl=${this.props.fhirServerUrl}`; //linkCopy.url += `&patientId=${this.props.patientId}`;