-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPatientFun.js
More file actions
27 lines (20 loc) · 771 Bytes
/
PatientFun.js
File metadata and controls
27 lines (20 loc) · 771 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import React from 'react';
import firestore from '@react-native-firebase/firestore';
export function addPatient(patient){
firebase.firestore().collection('Patient').add({
Name: patient.name,
Gender: patient.gender,
Condition: patient.condition,
ICUstatus: patient.ICUstatus,
recovDate: patient.recovDate,
}).then((data) => updateCurrent(data));
}
export async function getPatients(patientRetrieved){
var pList[];
var snap = await firebase.firestore().collection('Patient').get()
snap.forEach((doc) =>{
pList.push(doc.data());
});
updateCurrent(pList);
}
/* updateCurrent take a patient object and updates the beds based on the ICUstatus*\