Skip to content

trailingend/nativescript-palliative-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

☎️ PAT πŸ₯

The Palliative Assessment Tool (PAT) is an iOS application that provides on call palliative nurses with a structured documentation system as they process with a call. Once the call is finished, a pdf is generated that is sent via email and uploaded to PARIS.

Docs

Full documenation on Backend AND iOS App can be found at https://docs.palliative.vchlearn.ca/

The iOS portion of the docs and also be found below.


Usage

# Install dependencies
npm install

# Build for production
tns build ios --bundle --device "iPad (5th generation)"

# Build, watch for changes and run the application on Simulator
tns run ios --bundle --device "iPad (5th generation)"

# Build, watch for changes and run the application on VCH Learning Tech iPad
tns run ios --bundle --device <DEVICE_IDENTIFIER>

# Deploy the application to VCH Learning Tech iPad
tns deploy ios --bundle --device <DEVICE_IDENTIFIER> --clean --provision <PROVISION_ID>

# Lists all devices
tns device

# Lists all provision profiles installed in computer
tns prepare ios --provision

# VCH Learning Tech Team Info
"Team ID": 5MYA8389GQ
"Device Identifier for VCH Learning Tech iPad": 93ff730c6579308b561791adafec2fc96d59eec4

Libraries and Plugins

This app is developed with Nativescript, optimized for iPad 9.7 inches

Nativescript Dependency Versions

This project has very specific dependency requirements in order to compile. Further work would be needed to update from these speciifc package versions.

# nativescript and tns-core-modules version
"version": "5.4.3"

# nativescript tns-ios version
"version": "5.4.0"

# nativescript vue version
"version": "2.2.2"

# nativescript-dev-webpack version
"version": "0.25.0-next-2019-06-03-171607-01"

Dependencies

npm install jspdf --save
npm install @types/jspdf --save
npm install base-64 --save
npm install utf8 --save
npm install jspdf-autotable

Memory Management

With the current version of NativeScript we are using, we run into a memory leak issue, a.k.a. the app crashes and auto-exits after being used for a period of time, especially when lots of between-page navigation is happening. To fix this issue, we manually clear app memory every half second using nativescript's memory settings. There are two options to setup scheduled manually memory cleaning.nativescript's documentation. This app is currently using the first option.

  1. Via Schedule ⌚
    • "gcThrottleTime": 500
  2. Via Ratio βž—
    • "memoryCheckInterval": 500,
    • "freeMemoryRatio": 0.20

Project File Structure

  • assetsπŸ“‚ - folder for static assets
    • dataπŸ“‚ - folder for local data json file
    • imagesπŸ“‚ - folder for images
    • videosπŸ“‚ - folder for tutorial videos
  • componentsπŸ“‚ - folder for vue page and component files
  • fontsπŸ“‚ - folder for font files
  • scriptsπŸ“‚ - folder for global js files
  • stylesπŸ“‚ - folder for scss files
  • vuexπŸ“‚ - folder for data storage
  • app.scssπŸ“ƒ - entry for all style files
  • main.tsπŸ“ƒ - entry for all vue and js files

VueX Data Structure

General Structure of All Data Storage

  • curr_user_id πŸ†”
    • [Type] string, null state is -1
    • [Description] - ID of the nurse currently logged in to the app
    • [Related Places] - it will be changed mostly in Login/ AddUser/ Options page
  • timer ⏳
    • [Type] Object, null state is undefined
    • [Description] - ID of the nurse currently logged in to the app
    • [Related Places] - it will be changed mostly in Login/ AddUser/ Options page
  • users πŸ‘¬πŸ‘­
    • [Type] Array, null state is []
    • [Description] - list of users
    • [Related Places] - it will be changed mostly in SelectUser/ Login/ AddUser/ EditCallInfo pages
  • logs πŸ“„
    • [Type] Array, null state is []
    • [Description] - list of users
    • [Related Places] - it will be changed mostly in SelectUser/ Login/ AddUser/ EditCallInfo pages
  • data_version πŸ”–
    • [Type] Number, 0
    • [Description] - data version number
    • [Related Places] - it will be changed mostly in Dashboard pages; local data loading and online data loading methods change it.
  • tutorials πŸ“š
    • [Type] Array, null state is []
    • [Description] - content of tutorials, saved only locally in vue/state
    • [Related Places] - this is static content
  • intro πŸ“™
    • [Type] Array, null state is []
    • [Description] - data for introduction section
    • [Related Places] - it will be loaded from local data json file or online data json
  • protocols πŸ“”
    • [Type] Array, null state is []
    • [Description] - data for protocols section
    • [Related Places] - it will be loaded from local data json file or online data json
  • assessment_letters πŸ“—
    • [Type] Array, null state is []
    • [Description] - data for possible assessment letters used in protocols section
    • [Related Places] - it will be loaded from local data json file or online data json
  • plans πŸ“˜
    • [Type] Array, null state is []
    • [Description] - data for plans section
    • [Related Places] - it will be loaded from local data json file or online data json

Detailed Structure of Users Array

  • id πŸ†”
    • [Type] String
    • [Description] - employee ID of nurse user
  • name βœ’οΈ
    • [Type] String
    • [Description] - first name and initial of last name of nurse user
  • fullname πŸ“›
    • [Type] String
    • [Description] - first and last name of nurse user
  • shift_start πŸ•›
    • [Type] String, in millitary time
    • [Description] - shift start time
  • shift_end πŸ•£
    • [Type] String, in millitary time
    • [Description] - shift end time, if the time is less than shift start time, auto increment date
  • color 🎨
    • [Type] String
    • [Description] - color code associated with this nurse user

Detailed Structure of Logs Object Array

  • id πŸ†”
    • [Type] String, required field
    • [Description] - unique ID of client used by this app only, unique string based on creation time
  • phone ☎️
    • [Type] String, in format of XXXXXXXXXX, null state is 0000000000
    • [Description] - call-back number of client
  • caller πŸ“ž
    • [Type] String
    • [Description] - first and last name of caller
  • client πŸ‘€
    • [Type] String
    • [Description] - first and last name of caller
    • [Related Places] - this info will be used in email subject line and pdf name
  • relation πŸ‘₯
    • [Type] String
    • [Description] - caller's relationship to client
  • info πŸ“‹
    • [Type] String
    • [Description] - general info of client
  • notes πŸ“
    • [Type] String
    • [Description] - notes related with client
  • nurseID πŸ†”
    • [Type] String, in format of XXXXXX
    • [Description] - intake nurse employee ID
  • nurseFullname πŸ“›
    • [Type] String
    • [Description] - first and last name of caller
  • date πŸ“…
    • [Type] String, in format of DD MMM YYYY
    • [Description] - creation date
  • startTime πŸ•›
    • [Type] String, in millitary time
    • [Description] - call start time
  • endTime πŸ•£
    • [Type] String, in millitary time
    • [Description] - call end time
  • status 🚩
    • [Type] Boolean
    • [Description] - whether the document has been compiled as PDF and sent via email
  • progress πŸ“‡
    • [Type] Array of Numbers, null state is [-1, -2, 0, 0, 0, 0, 0]
    • [Description] The 6 items individually represents 1️⃣progress of the Introduction section, 2️⃣the selected protocol id, 3️⃣whether AssessItems page of current protocol is reached, 4️⃣whether AssessOthers page of current protocol is reached, 5️⃣whether Plans page is reached, 6️⃣whether Recommendations page is reached,7️⃣whether Summary page is reached.
      • @param {Number} intro progress - current step id of intro section
      • @param {Number} protocol id - current protocol id
      • @param {Number} protocol assess items page - binary [0, 1], whether reached, if protocol id is set, this variable is usually set to true
      • @param {Number} protocol assess others page - binary [0, 1], whether reached
      • @param {Number} recommendations page - binary [0, 1], whether reached
      • @param {Number} plans page - binary [0, 1], whether reached
      • @param {Number} summary page - binary [0, 1], whether reached
    • [Related Places] - this info is set in every pages in the linear flow of documenting. this info will be used in Client History section on Dashboard.
    • e.g.
      • [3, 3, 1, 1, 1, 1, 1] - currently reached Summary page
      • [3, 3, 1, 1, 1, 1, 0] - currently reached Plans page
      • [3, 3, 1, 1, 1, 0, 0] - currently reached Recommendations page of protocol 3
      • [3, 3, 1, 1, 0, 0, 0] - currently reached Assess Others page of protocol 3
      • [3, 3, 1, 0, 0, 0, 0] - currently reached Assess Items page of protocol 3
      • [3, -1, 0, 0, 0, 0, 0] - currently reached ChooseProtocol page
      • [3, -2, 0, 0, 0, 0, 0] - currently reached step 3 page of Introduction section
  • editHistory πŸ“°
    • [Type] Array, null state is []
    • [Description] each item in the array represents a change history. note that the initial submission is not in this history.
      • @param {String} nurse - take the id of the nurse currently logged in
      • @param {String} recordTime - document change time, in millitary time
      • @param {String} reason - reason and places for changes
    • e.g. see below
  • intro_answers πŸ“„
    • [Type] Array, null state is []
    • [Description] each item in the array represents a responded question in intro section.
      • @param {Number} q_id - question id
      • @param {Array} a - array of strings, each is an answer entry
    • e.g. see below
  • items_answers πŸ“„
    • [Type] Array, null state is []
    • [Description] each item in the array represents a responded protocol.
      • @param {Number} q_id - question id
      • @param {Array} a - array of objects, each is an answer entry of a items-assessment question in current protocol
        • @param {Number} q_id - question id
        • @param {String} q_type - question type
        • @param {Number} l_id - letter id
        • @param {Array} a - array of strings, each is an answer entry
    • e.g. see below
  • others_answers πŸ“„
    • [Type] Array, null state is []
    • [Description] each item in the array represents a responded protocol.
      • @param {Number} q_id - question id
      • @param {Array} a - array of objects, each is an answer entry of a additional question in current protocol
        • @param {Number} q_id - question id
        • @param {String} q_type - question type
        • @param {Array} a - array of strings, each is an answer entry
    • e.g. see below
  • plans_answers πŸ“„
    • [Type] Array, null state is []
    • [Description] each item in the array represents a plan entry.
    • e.g. see below
  • Recommendations πŸ“
    • [Type] String
    • [Description] - recommendations given to client

Example of editHistory Field with A Answer Entry of A Client in Logs

editHistory: [{
	"nurse": "777777",
	"recordTime": "20 Aug 2019 | 12:00",
	"reason": "Edited question 2 in intro section because of a spelling error"
}]

Example of intro_answers Field with A Answer Entry of A Client in Logs

intro_answers: [{
	"q_id": 4,
	"a": ["Cannot breathe"]
}]

Example of item_answers Field of A Protocol with A Answer Entry of A Client in Logs

items_answers: [{
	"id": 3,
	"a": [{
		"q_id": 10,
		"q_type": "single_select",
		"l_id": 1,
		"a": [
			"Yes – new symptom",
			"Happened 10 minutes ago"
		]
	}]
}]

Example of others_answers Field of A Protocol with A Answer Entry of A Client in Logs

others_answers: [{
	"id": 3,
	"a": [{
		"q_id": 3,
		"q_type": "free_form",
		"a": [
			"Caller"
		]
	}]
}]

Example of plans_answers Field with A Answer Entry of A Client in Logs

plans_answers: [
	"Reach out for medical support (e.g. MRP)",
	"Recommend going to UPCC (Urgent Primary Care Center)* if appropriate and unable to manage symptoms at home and if ambulatory and within client’s goals of care",
	""
]

Vue Pages / Components Structure

answers:open_file_folder:

  • [Description] - folder for components of different types of answers
  • [Members] - all answer typesare shared across sections
    • BooleanSelect.vueπŸ“ƒ - component for boolean answers
    • FreeText.vueπŸ“ƒ - component for free text answers
    • MultiSelect.vueπŸ“ƒ - component for multiple choice answers
    • ScaleSelect.vueπŸ“ƒ - component for scale selector answers
    • SingleSelect.vueπŸ“ƒ - component for single choice answers

general πŸ“‚

  • [Description] - folder for components and pages and components that is used across board
  • [Members] - include pages and components
    • partsπŸ“‚ - folder for sub-components
      • ClientBlock.vueπŸ“ƒ - component for the sticky yellow bar on top of any client page
      • NavBar.vueπŸ“ƒ - component for the sticky navigation bar on top of any page
    • Catalogue.vueπŸ“ƒ - pop-up frame/ page for choosing protocols, can be opened from ClientBlock
    • EditClient.vueπŸ“ƒ - pop-up frame/ page for editing client info, can be opened from ClientBlock and Summary
    • Notes.vueπŸ“ƒ - semi-page popup for additional nurse notes

home πŸ“‚ - folder for global js files

  • [Description] - folder for components and pages and components that is used in home/ dashboard screen
  • [Members] - include pages and components
    • partsπŸ“‚ - folder for sub-components
      • Logs.vueπŸ“ƒ - component for listview of client history, used in Dashboard
      • UserBlock.vueπŸ“ƒ - component for the user info at the top right corner of the Dashboard
    • AddUser.vueπŸ“ƒ - pop-up page for adding a new user, has to be opened from SelectUser frame
    • Dashboard.vueπŸ“ƒ - page for home screen/ dashboard
    • LoginUser.vueπŸ“ƒ - pop-up page for logging in an existing user, has to be opened from SelectUser frame
    • Options.vueπŸ“ƒ - pop-up frame/ page for option/ setting pages, opened from Dashboard
    • SelectUser.vueπŸ“ƒ - pop-up frame/ page for user management, can add, login, or delete a user here

intro πŸ“‚ - folder for scss files

  • [Description] - folder for components and pages and components that is used in introduction section
  • [Members] - include pages and components
    • partsπŸ“‚ - folder for sub-components
      • StepQuestion.vueπŸ“ƒ - component to determine which answer component to display for introduction questions
    • Introduction.vueπŸ“ƒ - page to show introduction questions
    • NewClient.vueπŸ“ƒ - page to add a new client

protocols πŸ“‚ - folder for data storage

  • partsπŸ“‚ - folder for sub-components
    • AssessItem.vueπŸ“ƒ - component to determine which answer component to display for items-assessment questions
    • OthersQuestion.vueπŸ“ƒ - component to determine which answer component to display for additional questions
    • RecommendButton.vueπŸ“ƒ - component to open Recommend pop-up, used in all protocol related pages
  • AssessItems.vueπŸ“ƒ - page to show items-assessment questions related with a protocol
  • AssessOthers.vueπŸ“ƒ - page to show additional questions related with a protocol
  • ChooseProtocol.vueπŸ“ƒ - page to choose a protocol
  • Plans.vueπŸ“ƒ - page to show plans to a client
  • Recommend.vueπŸ“ƒ - pop-up frame/ page fto show related resources, protocols and recommendation of a protocol
  • Recommenddations.vueπŸ“ƒ - page to show recommendations to a client

summary πŸ“‚ - folder for scss files

  • partsπŸ“‚ - folder for sub-components
    • CallSummary.vueπŸ“ƒ - component to show summary of the call information
    • InfoSummary.vueπŸ“ƒ - component to show summary of client information
    • IntroSummary.vueπŸ“ƒ - component to show summary of introduction section
    • NoteSummary.vueπŸ“ƒ - component to show summary of global additional notes
    • PlanSummary.vueπŸ“ƒ - component to show summary of plans
    • ProtocolSummary.vueπŸ“ƒ - component to show summary of one protocol
    • QuestionSummary.vueπŸ“ƒ - component to show summary of one question and its answers
    • RecommendationsSummary.vueπŸ“ƒ - component to show summary of recommendations
    • SubmitButton.vueπŸ“ƒ - component to generate PDF, and to send email
  • EditCallInfo.vueπŸ“ƒ - popup page/ frame to edit call information, opened from Summary
  • Reason.vueπŸ“ƒ - semi-page popup to record pdf modification history
  • Summary.vueπŸ“ƒ - page to show summary of a client

tutorials πŸ“‚ - folder for data storage

  • FirstTime.vueπŸ“ƒ - pop-up page to show tutorial welcome screen
  • Journey.vueπŸ“ƒ - pop-up page to show tutorials
  • Tutorial.vueπŸ“ƒ - pop-up frame, to either pull from Journey or FirstTime

About

Nativescript-based iPad app for palliative nurses

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published