Pwablo
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    1
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    <div style="text-align:center"> <h1> MedC2: Technical Challenge & Sol </h1> <a href="mailto:g.gustin@medc2.com">Author: Guillaume Gustin </a> </div> ## Introduction To help us in our ambitious projects, MedC2 is looking for a new team member taking the lead role of *Digital Health Full tack Developer*. His/her responsibilities will mainly be coding, maintaining, expanding our ehealth apps in a fast-paced environment. In addition, he should be able to translate user requirements into the overall architecture and work proactively as part of a scrum team of 3-4 developers. The main technical skills are: - A strong knowledge of at least one backend MVC framework (ideally in Node.js, e.g. Express) - A good knowledge of at least one frontend Javascript framework (ideally Angular, Ionic) - A basic understanding of interoperability requirements and standards in Healthcare To make sure you might be a fit for that position, we would like to challenge you! Are you ready ? ![](https://i.imgur.com/KlH6vfc.png) --- :::danger ### Deliverables At the end of this challenge, you'll be asked to share with us: 1. A *PDF report* under the title: `"medc2_technical_challenge_<your_name>.pdf"` gathering the answers to the questions, as well as any comment describing the design choices you've made throughout this challenge and how we can test your solution. 2. The access to your source code, preferably hosted in a **Github** repository 3. The URL allowing us to test your real-life PWA prototype ::: :::warning ⚠️ This document is confidential and should not be shared ::: ## 1. The Interoperability Magic Making the exchange of healthcare information safer and faster has been a primary goal in the healthcare industry. Healthcare is currently buried under mountains of data, but much of it is unorganized or out of reach. People responsible for emergency care may not have the patient history they need which might force them to resort to guessing or basing their treatment on the information the patient provides. If the patient is unable to give any history or allergy information, the problem gets worse. **FHIR (Fast Healthcare Interoperability Resources) if used as a standard, removes these problems and puts a patient’s history at the doctor’s fingertips.** [[Source]](https://datica.com/blog/it-developers-guide-to-fhir-for-healthcare) ![](https://i.imgur.com/JSeDrLg.png) :::info In the following exercise, you are expected to: - Document yourself about the FHIR standard if non-familiar - Setup your own FHIR server ::: --- #### Q1.1 Give a JSON example of the FHIR representation of a Questionnaire (e.g. Patient Reported Outcomes) #### Q1.2 Give a JSON example of the FHIR representation of a Blood Pressure Measurement #### Q1.3 Clone an existing FHIR server project and run it locally. Briefly describe your choice and the steps you followed (max 250 words). --- :::info #### Remarks 💡 Hint : Do not reinvent the weel and re-use <u>[Open Source FHIR implementations](https://wiki.hl7.org/index.php?title=Open_Source_FHIR_implementations) </u> ☝️ **NB** At MedC2, we love Node.js and MongoDB but we, of course, stay open-minded ::: ## 2. Deploy it in the Cloud There has been a massive shift in the generation, consumption, storage, and sharing of healthcare data. From conventional storage to digitalization of healthcare data, the healthcare industry has sure come a long way in optimizing its data management practices. For an industry that has historically lagged behind its contemporaries, the healthcare segment is leading on cloud adoption. Healthcare providers are now leveraging this technology to gain efficiencies, optimize workflows, lower the costs associated with healthcare delivery and offer personalization in care plans to improve outcomes. Nowadays, Cloud computing appears like a wise choice to scale up a digital health project. [[Source]](https://www.healthitoutcomes.com/doc/ways-cloud-computing-is-impacting-healthcare-0001) --- #### Q2.1 Deploy your FHIR server from Exercise 1 on a Cloud provider of your choice. Briefly describe your decision and the deployment steps. (max 250 words) #### Q2.2 Add a FHIR Patient Resource with details including your personal information (e.g. name, first name, mail address). How can we test your server? #### Q2.3 More than ever (#covid), Cloud security is a MUST. What could be done to enhance security of your architecture and deal with sensitive health data (max 250 words)? --- :::info #### Remarks ☝️ **NB** At MedC2, we love using Google Cloud Platform but we, of course, stay open-minded 💡 Hint: Btw Postman is cool </u> ::: ## 3. Develop a basic PWA These days Progressive Web Apps (PWA) are become very trendy. With the combined features of websites and native apps, PWAs are becoming a norm for multi-device web applications allowing developers to build fast-loading dynamic apps without using hybrid frameworks. Combined with [Firebase](https://themesfinity.com/in-a-nutshell-firebase/#:~:text=It%20is%20a%20NoSQL%20cloud,a%20key%20or%20a%20value), which offers a comprehensive Backend-as-a-Service, and cloud serverless functions, it has become faster than ever to bootstrap any small cross-platform prototype. :::info > *In the following exercise, let us imagine we decide to extend FHIR interoperability capabilities and pull the administrative data for non-healthcare purposes (which may probably lead to privacy concerns in real-life btw) to build an app to compare job applicant's profiles. Soft and hard skills data, linked to the Candidate ID, would be stored in another Database: Cloud Firestore.* In this section, you are expected to develop a basic PWA complying with the following requirements: - The app must include (at least) two pages accessible through bottom tabs: 1. The first page should allow to search for a specific Candidate profile stored in your FHIR architecture, based on his ID (former "patient profile id"), and nicely display basic contact details. 2. The second page should allow to compare two candidates profiles side by side by skills, by making use of a radar chart and pulling data from Cloud Firestore. - The app must respect the <u>[PWA specifications](https://web.dev/lighthouse-pwa/)</u> #### Example Mockups | Screen 1 | Screen 2 | | -------- | -------- | | <img width="600px" src="https://i.imgur.com/bzCvqx1.png"> | <img width="600px" src="https://i.imgur.com/hv9haAs.png"> ::: :::info 🛠 **Resources/Hints/Links** * Start a Angular-Ionic project with tabs ```bash ionic start myResumeApp tabs --type=ionic-angular ``` > ☝️ NB: At MedC2, we prefer using **Angular** and **Ionic** on top of **Firebase** to fastly develop high-fidelity prototypes, but we stay open-minded on the technical stack :-) * Pssst, you may be interested by a [JavaScript client for FHIR](https://github.com/FHIR/fhir.js). * Do not forget to add (at least) a second Patient Resource under another ID on your FHIR server (cfr Exercise 1) * Define Typescript interfaces representing *Hard Skills* and *Soft Skills* (e.g. as defined [here](https://www.indeed.com/career-advice/resumes-cover-letters/hard-skills-vs-soft-skills)). Then, populate Cloud Firestore with *Hard Skills* and *Soft Skills* values and create the corresponding Angular Service to fetch them. Make sure you link the *Skills* instances with IDs existing in your FHIR server. 👉 [This link is, I think, a nice introduction to Angular x Firestore](https://www.mode2.com/news/part-two-angular-with-firestore-intro/) 👉 **Bonus**: When populating the DB, be creative and try to self-assess your own skills under your ID 😊 * [Have you heard about ng2-charts library ?](https://www.positronx.io/angular-chart-js-tutorial-with-ng2-charts-examples/) * [Ensure you add PWA capabilities and deploy on Firebase Hosting](https://medium.com/@AnkitMaheshwariIn/build-a-progressive-web-app-pwa-with-ionic-4-ionic-framework-and-firebase-48183519c01) </u> * Optional: [Add photos to your Patient Resources](https://stackoverflow.com/questions/43482358/fhir-patient-how-to-upload-and-retrieve-patient-photo) * Optional: [Add Dark Mode support](https://petercoding.com/ionic/2020/02/15/implementing-dark-mode-in-ionic-5/) ::: --- #### Q3.1 Deploy your PWA app and give us access to the URL, the source code, and the Firebase project by adding g.gustin@medc2.com and thomas.kleyntssens@comunicare.be in the collaborators. #### Q3.2 According to you, what could be done to enhance the security of the app ? (At least 2 measures, max 200 words) --- ## 4. Build a serverless Fibonacci Web Service The Fibonacci numbers are the numbers in the following integer sequence: ``` 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ... ``` In mathematical terms, the sequence `Fn` of Fibonacci numbers is defined by the recurrence relation `Fn = Fn-1 + Fn-2` with seed values `F0 = 0 and F1 = 1` The Fibonacci pattern is seen in many natural phenomenon, for example in the smallest nautilus and even in the shape of the largest galaxy’s. The sequence also has directly connected with the golden ratio and is used throughout history in many works of art such as the Mona Lisa, but it doesn’t stop here, the Fibonacci sequence can even be heard in music. [[Source]](https://www.fibonicci.com/fibonacci/the-sequence/) --- #### Q4.1 There are 3 different ways of implementing the Fibonacci algorithm. Which are they ? Implement `fib1(n)`,`fib2(n)`,`fib3(n)` that return `Fn`. #### Q4.2 What are the time and space complexity of each of these algorithms ? --- :::info Serverless applications have gained a lot of importance over time. It allows focussing on your app code/tests without worrying about configurations, deployment process or scalability. In this exercise, we ask you to build a RESTful Web Service complying with the following statements: - The web service accepts a number, n, as input and returns the first n Fibonacci numbers, starting from 0 (i.e. given n = 5, appropriate output would represent the sequence [0, 1, 1, 2, 3]) - Given a negative number, it will respond with an appropriate error - The service should include some units and/or functional tests ::: #### Q4.3 Implement a serverless web service in `Node.js` over `Express.js` with Firebase Cloud functions. How can we call your API endpoints ? :::warning ## Parts of Solution (to be hidden for candidates) ### Exercice 1 * https://www.hl7.org/fhir/questionnaire-cqf-example.json.html * http://hl7.org/fhir/us/patient-reported-outcomes/2018Sep/guidance.html * [MongoDB Atlas + FHIR](https://www.mongodb.com/blog/post/building-fhir-applications-with-mongodb-atlas) ### Exercice 2 * [Quickstart for Node.js in the standard environment](https://cloud.google.com/appengine/docs/standard/nodejs/quickstart) * [Install the latest Cloud SDK version](https://cloud.google.com/sdk/docs) * Add patient record ```bash curl -X PUT -H "Content-Type: application/fhir+json" -H "Cache-Control: no-cache" --data @createpatient.json http://my-fhir-server.com/4_0_0/Patient/example ``` where `@createpatient.json` is the customised FHIR Patient profile and `my-fhir-server.com` the cloud domain. * Read patient record ```bash curl -X GET http://my-fhir-server.com/4_0_0/Patient/example ``` OR * [Link: use Postman to deal with the FHIR server](https://docs.microsoft.com/en-us/azure/healthcare-apis/access-fhir-postman-tutorial) #### Architecture ![](https://i.imgur.com/5F2LLWT.png) #### Security MongoDB * **Network Isolation** MongoDB Atlas dedicated clusters are deployed in a unique Virtual Private Cloud (VPC) with dedicated firewalls. Access must be granted by an IP access list or VPC Peering. * **Role-based access management** * **End-to-end encryption** - All network traffic is encrypted using Transport layer Security (TLS) - Client-side encryption to encrypt sensitive data before it leaves the application and lands in the cloud. #### Security GCP * https://cloud.google.com/context-aware-access/docs/securing-app-engine ## Exercise 3 * [Radar chart with Stackblitz](https://stackblitz.com/edit/ng2-charts-radar-template) ### 3.2 * [Role-based access control](https://firebase.google.com/docs/firestore/solutions/role-based-access) * [Use Angular Route-Guards](https://medium.com/javascript-in-plain-english/use-angular-route-guards-to-secure-angular-pages-by-allow-deny-or-redirect-to-other-page-view-f2537583e9a) * Client-side encryption ```javascript= import * as CryptoJS from 'crypto-js'; encryptData(data) { try { return CryptoJS.AES.encrypt(JSON.stringify(data), this.encryptSecretKey).toString(); } catch (e) { console.log(e); } } decryptData(data) { try { const bytes = CryptoJS.AES.decrypt(data, this.encryptSecretKey); if (bytes.toString()) { return JSON.parse(bytes.toString(CryptoJS.enc.Utf8)); } return data; } catch (e) { console.log(e); } } ``` * NB: [Managing Encryption Keys With AWS KMS In Node.js](https://hackernoon.com/managing-encryption-keys-with-aws-kms-in-node-js-c320c860019a) ## Exercise 4 #### Q4.1 Three different ways of implementing Fibonacci algorithm ```javascript= function loopFib(num) { var num1=0; var num2=1; var sum; var i=0; for (i = 0; i < num; i++) { sum=num1+num2; num1=num2; num2=sum; } return num2; } function naiveFib(nbr) { if(nbr < 2){ return nbr; } return fibonacci(nbr - 1) + fibonacci(nbr - 2); } var memoFib = function(n) { let memo = {} function fib(n) { if (n in memo) { return memo[n] } else { if (n <= 1) { memo[n] = n } else { memo[n] = fib(n - 1) + fib(n - 2) } return memo[n] } } return fib(n); } console.log(memoFib(8)) ``` * https://repl.it/@GuillaumeGst/Fibo3Ways * https://medium.com/javascript-in-plain-english/three-ways-to-write-a-fibonacci-function-in-javascript-a711db62788e ### 4.2 Recursion — Big O(2^N) Memoization — O(N) — time, O(N) — space Bottoms Up — O(N) — time, O(1) — space ### 4.3 Serverless API * https://dev.to/levivm/creating-a-serverless-rest-api-using-google-cloud-functions-firebasefirestore-in-10-min-37km * https://codeburst.io/building-a-serverless-api-using-firebase-cloud-functions-e5a6be42144c :::

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully