+
{{ vitalUnits }}
+
-
+
-
+
-
-
+
+
-
+
{{ timeSince }}
-
-
+
+
-
-
-
diff --git a/src/app/components/vital-signs/vital-signs.component.ts b/src/app/components/vital-signs/vital-signs.component.ts
index cbf629a..b4f21e3 100644
--- a/src/app/components/vital-signs/vital-signs.component.ts
+++ b/src/app/components/vital-signs/vital-signs.component.ts
@@ -20,18 +20,20 @@ export class VitalSignsComponent implements OnInit, OnChanges {
vitalTheme = 'light';
vitalTitle = '';
vitalUnits = '';
+ vitalUnits2 = '';
vitalType = '';
imageID = '';
currentTrend = 0;
trendClass = 'trendFlat';
+ visibleSecond = false;
+
vitalImage = '';
vitalValue = '--';
+ vital2Value = '--';
vitalTextClass = 'Normal';
+ vital2TextClass = 'Normal';
vitalIconClass = 'icon-Normal';
- hrBT = 'hideModal';
-
- hrActive = 'col';
timer = 0;
timerId = 0;
@@ -51,6 +53,9 @@ export class VitalSignsComponent implements OnInit, OnChanges {
constructor() {}
+ /**
+ *
+ */
ngOnInit() {
console.log(`VitalSignsComponent::Init - ${this.thisID}`, this.config);
@@ -71,12 +76,22 @@ export class VitalSignsComponent implements OnInit, OnChanges {
this.vitalImage = `${this.config.vitalType}Normal`;
}
+ if (this.config && this.config.vitalUnits2) {
+ this.vitalUnits2 = this.config.vitalUnits2;
+ this.visibleSecond = true;
+ }
+
this.vitalTheme = !this.theme ? 'light' : 'dark';
clearTimeout(this.timerId);
this.timer = 0;
}
+ /**
+ * Generates a new icon url string
+ *
+ * @return A new url to the correct icon
+ */
thisIcon(): string {
if (this.imageID) {
return `assets/imgs/${this.vitalImage}.png`;
@@ -85,26 +100,28 @@ export class VitalSignsComponent implements OnInit, OnChanges {
return '';
}
- changeHR(): void {
- console.log(`VitalSignsComponent::changeHR - ${this.thisID}`);
+ /**
+ * Click handler to request the keypad
+ */
+ requestReading(): void {
+ console.log(`VitalSignsComponent::requestReading - ${this.thisID}`);
this.clearVitals();
- /*this.vitalRequested = 'BPM';
- this.padVisible = true;
- this.hrActive = 'col vitalToFront';*/
+
this.doRequestInput();
}
+ /**
+ *
+ */
clearVitals(): void {
this.padVisible = false;
- this.hrActive = 'col';
- /*this.brActive = "col";
- this.satsActive = "col";
- this.bpActive = "col";
- this.tempActive = "col";*/
this.keyboardVis = 'hideModal';
}
+ /**
+ * Updates the timer text and restarts the minute timer
+ */
updateTimer(): void {
this.timer++;
@@ -123,6 +140,9 @@ export class VitalSignsComponent implements OnInit, OnChanges {
}, 60000);
}
+ /**
+ * Recalculates the trend
+ */
recalculateTrend(): void {
const sequence: number[] = this.history.map((item: VitalReading): number => {
return parseInt(item.reading, 10);
@@ -139,6 +159,12 @@ export class VitalSignsComponent implements OnInit, OnChanges {
}
}
+ /**
+ * Responds to the updated vitals reading from the keypad, updates colour and icons accordingly
+ * @param vitalSign The vital sign
+ * @param vitalValue The Vital value
+ * @param override An override flag
+ */
checkVitals(vitalSign: string, vitalValue: string, override?: boolean): string {
// console.log("sign: " + vitalSign + " - value: " + vitalValue);
if (vitalValue === '--') {
@@ -247,6 +273,9 @@ export class VitalSignsComponent implements OnInit, OnChanges {
}
}
+ /**
+ * Emits the updated reading
+ */
doUpdate(): void {
const output = Object.assign({}, this.config, this.newReading);
@@ -255,18 +284,26 @@ export class VitalSignsComponent implements OnInit, OnChanges {
this.onRequestUpdate.emit(output);
}
+ /**
+ * Emits a request to display the keypad with specific units
+ */
doRequestInput(): void {
this.requestInput.emit({
vitalUnits: this.vitalUnits
});
}
+ /**
+ * Handles changes to the input variables
+ * @param changes
+ */
ngOnChanges(changes: SimpleChanges): void {
console.log(`VitalSignsComponent::changes - ${this.thisID}`, changes);
if (changes.hasOwnProperty('newReading') && changes.newReading.isFirstChange() !== true) {
if (this.newReading.reading !== 'closePad') {
clearTimeout(this.timerId);
+
this.vitalValue = this.newReading.reading;
const newHistory: VitalReading = this.newReading;
diff --git a/src/app/home/home.module.ts b/src/app/home/home.module.ts
index 8f661a1..c26e8c6 100644
--- a/src/app/home/home.module.ts
+++ b/src/app/home/home.module.ts
@@ -10,6 +10,7 @@ import {CpsTopBottomComponentModule} from '../components/cps-top-bottom/cps-top-
import { VitalSignsComponentModule } from '../components/vital-signs/vital-signs.module';
import { AVPUSwipeComponentModule } from '../components/avpu-swipe/avpu-swipe.module';
import { NumPadComponentModule } from '../components/num-pad/num-pad.module';
+import { VitalSignsBpComponentModule } from '../components/vital-signs-bp/vital-signs-bp.module';
@NgModule({
@@ -22,7 +23,8 @@ import { NumPadComponentModule } from '../components/num-pad/num-pad.module';
CpsTopBottomComponentModule,
VitalSignsComponentModule,
AVPUSwipeComponentModule,
- NumPadComponentModule
+ NumPadComponentModule,
+ VitalSignsBpComponentModule
],
declarations: [HomePage]
})
diff --git a/src/app/home/home.page.html b/src/app/home/home.page.html
index ea0dde2..29e327f 100644
--- a/src/app/home/home.page.html
+++ b/src/app/home/home.page.html
@@ -25,6 +25,120 @@
-->
+
+
+ vital-signs + num-pad chain
+
+
+
+
+
+
+
+
+
+
+
+
+
+ vital-signs-bp + num-pad chain
+
+
+
+
+
+
+
+
+
+
+
vital-signs + num-pad chain
@@ -219,7 +333,7 @@
New Reading
-
+
Set
@@ -254,6 +368,9 @@
+
+
+
app-cps-confirm-button
diff --git a/src/app/home/home.page.ts b/src/app/home/home.page.ts
index eae8f44..1786722 100644
--- a/src/app/home/home.page.ts
+++ b/src/app/home/home.page.ts
@@ -60,6 +60,7 @@ export class HomePage {
vitalUnits2: 'dia',
imageID: 'bpOK'
};
+
topBottomChainVal = '';
constructor() {}
@@ -68,6 +69,7 @@ export class HomePage {
testBR: string;
testSATS: string;
testTEMP: string;
+ testBP: string;
blankVitalsReturnData: VitalsUpdate = {
vitalTitle: '',
@@ -86,10 +88,13 @@ export class HomePage {
tempVitalsReturnData: VitalsUpdate = { ...this.blankVitalsReturnData };
+ bpVitalsReturnData: VitalsUpdate = { ...this.blankVitalsReturnData };
+
newHRValue: VitalReading;
newBRValue: VitalReading;
newSATSValue: VitalReading;
newTEMPValue: VitalReading;
+ newBPValue: VitalReading;
vitalTheme = false;
padVisible = false;
@@ -153,6 +158,16 @@ export class HomePage {
}
}
+ testSetBP() {
+ console.log('testSetBP', this.testSATS);
+ if (this.testBP !== null) {
+ this.newBPValue = {
+ reading: this.testBP,
+ timestamp: Date.now()
+ };
+ }
+ }
+
/**
* Captures the data exported from a vitals component
* @param e the exported VitalsUpdate
@@ -174,7 +189,12 @@ export class HomePage {
captureTEMPVitalsUpdate(e: object): void {
console.log('captureTEMPVitalsUpdate', e);
- this.satsVitalsReturnData = e as VitalsUpdate;
+ this.tempVitalsReturnData = e as VitalsUpdate;
+ }
+
+ captureBPVitalsUpdate(e: object): void {
+ console.log('captureBPVitalsUpdate', e);
+ this.bpVitalsReturnData = e as VitalsUpdate;
}
/**
@@ -203,4 +223,11 @@ export class HomePage {
this.vitalRequested = event.vitalUnits;
this.padVisible = true;
}
+
+ bpRequestInput(event: object) {
+ console.log('vitalsRequestInput', event);
+ // @ts-ignore
+ this.vitalRequested = 'mmHg';
+ this.padVisible = true;
+ }
}