Giter Club home page Giter Club logo

swm-dd-demo's Introduction

swm-dd-demo

Demo code for the June 2021, HL7 FHIR DevDays - SMART Web Messaging Events

Important Links

swm-dd-demo's People

Contributors

barabo avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

swm-dd-demo's Issues

ui.done should close the embedded app with an interruptible countdown.

A panel that counts down for like 10 seconds should pop up and say 'ui.done message received. Closing app in 5..4..3.. seconds'.

There should be a cancel button displayed that makes the pop-up panel disappear.

If not cancelled, the iframe is 'closed' and a 'reload app' button is displayed in its place. When clicked, the app is reloaded.

Nit: change Scratchpad button text

This is a minor issue, but it would be nice if the button that says Scratchpad instead said 'Show Scratchpad' until clicked, then changed to 'Hide Scratchpad' when visible.

Copy to Clipboard

  • Replace the 'copy to clipboard' button with a fixed position translucent button over the textarea in the upper right corner.
  • Add a 'copy to clipboard' feature to the scratchpad panel.

Remove all symlinks from codebase.

The ehr and app both use a symlink lib -> ../lib for the library import. Instead, each app should npm install the library and it should be bundled by snowpack when deployed.

EHR needs configuration options

The EHR currently hardcodes two important configuration settings
[ ] app iframe source (which is also appOrigin)
[ ] the session handle value (which must match the app value)

The UI must expose a way to change these settings.

Apply async functionality to client library

  • swm.sendMessage('customEHR.watchClicks', {...payload}) - handle a stream of responses via generator
  • swm.createClient - creates a client object using the messaging handle and target origin
  • client.sendMessage('status.handshake') - or any other known types. returns a promise.
  • client.sendResponseTo(message) - reads the messageId and sets responseToMessageId
  • use new client in app and ehr
  • swm.discover() - returns library details

Reduce UI clutter

  • for all received messages, automatically insert the matching template response if possible
  • replace list of buttons with an HTML select tag
  • simplify the color scheme to make it more obvious what is EHR and what is embedded app
  • clicking on a button in the app should reset the response message panel
  • The configuration buttons should always be statically placed in the upper right corner of the screen
  • App footer does not need to be there (or maybe only for non-embedded cases)

App needs configuration options

Currently the app uses a mock SMART client object to extract the smart_web_messaging_handle and smart_web_messaging_origin launch parameters. These values are currently hardcoded in the app code, and the UI provides no way for them to changed without a code change.

There must be a way to configure the app from the UI.

clear 'message' panel when config changes

In the app, when the config changes to update the messaging handle, if there is a value already in the messaging panel, it may have a different handle in the message envelope. This can be confusing to the user if a new message is not generated after updating the client. We scratched our heads over this for at least 15 minutes during the code review.

New DevDays Exercise App

Create a new demo app for the Tutorial session that has no swm capabilities yet.

During the session, the presenter will check out the app, launch it, install the client lib with npm, then implement heartbeat and ui.done functionality.

Library needs a way to disablePostMessage API on disconnect.

One way for the client to do it would be like this:

import * as swm from 'swm-client-lib';
...
swm.enablePostMessage('http://localhost:9999', someCallback);
...
swm.disablePostMessage();

Alternatively, the client user could do this:

import * as swm from 'swm-client-lib';
...
const x = swm.enablePostMessage('http://localhost:9999', someCallback);
...
swm.disablePostMessage(x);

Not sure which I like better.

app UI improvements

fix: app panel should be forced to the bottom of the page, right above the footer.

Scratchpad updates

The scratchpad should be a thin blue bar under the EHR heading that shows the # of entries and a button to expand the contents.

When expanded, it is a modal dialog that can be closed to return to the EHR.

Participant Instructions Needed

It would be helpful to have two sets of instructions for participants. One for App developers and another for Ehr developers wishing to use the tool to test their implementations.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.