Skip to content

Commit

Permalink
feat: add medical evaluation form
Browse files Browse the repository at this point in the history
  • Loading branch information
hopetambala committed Oct 2, 2020
1 parent 50373da commit fec481a
Show file tree
Hide file tree
Showing 8 changed files with 264 additions and 67 deletions.
5 changes: 4 additions & 1 deletion components/MainNavigation/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ const MainNavigation = () => {
<Stack.Screen name="Sign Up" component={SignUp} options={{ headerShown: false }} />
<Stack.Screen name="GetPincode" component={GetPinCode} options={{ headerShown: true }} />
<Stack.Screen name="StorePincode" component={StorePinCode} options={{ headerShown: true }} />
<Stack.Screen name="Root" component={BottomTabNavigator} options={{ headerShown: false }}
<Stack.Screen
name="Root"
component={BottomTabNavigator}
options={{ headerShown: false }}
/>
</Stack.Navigator>
</NavigationContainer>
Expand Down
94 changes: 46 additions & 48 deletions domains/DataCollection/FormGallery/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,55 +8,53 @@ import {

import { layout, theme } from '../../../modules/theme';

import ComingSoonSVG from '../../../assets/graphics/static/Adventurer.svg'
import ComingSoonSVG from '../../../assets/graphics/static/Adventurer.svg';

const FormGallery = ({ setDataCollectionView }) => {
return (
<View>
<Button icon="arrow-left" width={100} onPress={() => { setDataCollectionView('Root') }}>
<Text>Back</Text>
</Button>
<View style={layout.screenRow}>
<Text>Puente Forms</Text>
<ScrollView horizontal>
<Card style={screenLayout.card}>
<Text>Env Health</Text>
</Card>
<Card style={screenLayout.card}>
<Text>Medical Assessment</Text>
</Card>
<Card style={screenLayout.card}>
<Text>Vitals</Text>
</Card>
<Card style={screenLayout.card}>
<Text>Vitals</Text>
</Card>
<Card style={screenLayout.card}>
<Text>Vitals</Text>
</Card>
</ScrollView>
</View>
<View style={layout.screenRow}>
<Text>Custom Forms</Text>
</View>
<View style={layout.screenRow}>
<Text>Manage My Pinned Forms</Text>
</View>
<View style={layout.screenRow}>
<Card>
<Card.Content>
<ComingSoonSVG width={200} height={200} />
<Title>Our Marketplace</Title>
<Paragraph>Discover forms created by trusted companies</Paragraph>
<Button >
<Text >Explore Forms</Text>
</Button>
</Card.Content>
const FormGallery = ({ setDataCollectionView }) => (
<View>
<Button icon="arrow-left" width={100} onPress={() => { setDataCollectionView('Root'); }}>
<Text>Back</Text>
</Button>
<View style={layout.screenRow}>
<Text>Puente Forms</Text>
<ScrollView horizontal>
<Card style={screenLayout.card}>
<Text>Env Health</Text>
</Card>
</View>
<Card style={screenLayout.card}>
<Text>Medical Assessment</Text>
</Card>
<Card style={screenLayout.card}>
<Text>Vitals</Text>
</Card>
<Card style={screenLayout.card}>
<Text>Vitals</Text>
</Card>
<Card style={screenLayout.card}>
<Text>Vitals</Text>
</Card>
</ScrollView>
</View>
<View style={layout.screenRow}>
<Text>Custom Forms</Text>
</View>
<View style={layout.screenRow}>
<Text>Manage My Pinned Forms</Text>
</View>
<View style={layout.screenRow}>
<Card>
<Card.Content>
<ComingSoonSVG width={200} height={200} />
<Title>Our Marketplace</Title>
<Paragraph>Discover forms created by trusted companies</Paragraph>
<Button>
<Text>Explore Forms</Text>
</Button>
</Card.Content>
</Card>
</View>
)
}
</View>
);

const screenLayout = StyleSheet.create({
card: {
Expand All @@ -68,6 +66,6 @@ const screenLayout = StyleSheet.create({
marginVertical: 5
}

})
});

export default FormGallery
export default FormGallery;
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const configArray = {
class: 'HistoryEnvironmentalHealth',
name: 'Environmental Health Form',
fields: [{
label: 'Years Lived in the Community',
formikKey: 'yearsLivedinthecommunity',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
const configArray = {
class: 'EvaluationMedical',
name: 'Medical Assessment Form',
fields: [{
label: 'chronic_condition_hypertension',
formikKey: 'chronic_condition_hypertension',
value: '',
fieldType: 'select',
options: [
'Yes',
'No',
]
},
{
label: 'chronic_condition_diabetes',
formikKey: 'chronic_condition_diabetes',
value: '',
fieldType: 'select',
options: [
'Yes',
'No',
]
},
{
label: 'chronic_condition_other',
formikKey: 'chronic_condition_other',
value: '',
fieldType: 'select',
options: [
'Yes',
'No',
]
},
{
label: 'seen_doctor',
formikKey: 'seen_doctor',
value: '',
fieldType: 'select',
options: [
'Yes',
'No',
]
},
{
label: 'received_treatment_notes',
formikKey: 'received_treatment_notes',
value: '',
fieldType: 'input'
},
{
label: 'received_treatment_description',
formikKey: 'received_treatment_description',
value: '',
fieldType: 'select',
options: [
'receiving_treatment_no_support_required',
'receiving_treatment_support_required',
'awaiting_treatment_support_required',
'no_treatment_support_required',
'other'
]
},
{
label: 'part_of_body',
formikKey: 'part_of_body',
value: '',
fieldType: 'select',
options: [
'bones_or_joints',
'eyes',
'ear_nose_throat',
'skin',
'head_mental_issue',
'stomach_intestines',
'bladder_urinary',
'reproductive_organs',
'nutrition',
'',
]
},
{
label: 'part_of_body_description',
formikKey: 'part_of_body_description',
value: '',
fieldType: 'input'
},
{
label: 'duration',
formikKey: 'duration',
value: '',
fieldType: 'select',
options: [
'within_last_month',
'within_last_year',
'within_last_5_years',
'after_5_years',
'',
]
},
{
label: 'trauma_induced',
formikKey: 'trauma_induced',
value: '',
fieldType: 'select',
options: [
'suddenly_due_to_trauma',
'suddenly_but_not_due_to_trauma',
'gradually',
]
},
{
label: 'condition_progression',
formikKey: 'condition_progression',
value: '',
fieldType: 'select',
options: [
'improve',
'worsen',
'constant',
]
},
{
label: 'notes',
formikKey: 'notes',
value: '',
fieldType: 'input'
},
{
label: 'AssessmentandEvaluation',
formikKey: 'AssessmentandEvaluation',
value: '',
fieldType: 'select',
options: [
'Yes',
'No',
]
},
{
label: 'AssessmentandEvaluation_Surgical',
formikKey: 'AssessmentandEvaluation_Surgical',
value: '',
fieldType: 'select',
options: [
'Yes',
'No',
]
},
{
label: 'AssessmentandEvaluation_Surgical_Guess',
formikKey: 'AssessmentandEvaluation_Surgical_Guess',
value: '',
fieldType: 'input'
},
{
label: 'immediate_follow_up',
formikKey: 'immediate_follow_up',
value: '',
fieldType: 'select',
options: [
'Yes',
'No',
]
},
{
label: 'planOfAction',
formikKey: 'planOfAction',
value: '',
fieldType: 'input'
},
]
};

export default configArray;
4 changes: 3 additions & 1 deletion domains/DataCollection/Forms/SupplementaryForm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { postObjectsToClassWithRelation } from '../../../../services/parse/crud'
import { layout } from '../../../../modules/theme';

import envConfig from './configs/envhealth.config';
import medConfig from './configs/medical-evaluation.config';

import PaperInputPicker from '../../../../components/FormikFields/PaperInputPicker';

Expand All @@ -28,7 +29,8 @@ const SupplementaryForm = ({

useEffect(() => {
if (selectedForm === 'env') setConfig(envConfig);
}, [selectedForm, envConfig]);
if (selectedForm === 'med-eval') setConfig(medConfig);
}, [selectedForm]);

return (
<Formik
Expand Down
39 changes: 30 additions & 9 deletions domains/DataCollection/Forms/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from 'react';
import { View } from 'react-native';
import { View, ScrollView, StyleSheet } from 'react-native';
import { Text, Card } from 'react-native-paper';

import IdentificationForm from './IdentificationForm';
Expand All @@ -8,6 +8,14 @@ import SupplementaryForm from './SupplementaryForm';
import GdprCompliance from '../GdprCompliance';
import { layout } from '../../../modules/theme';

const puenteForms = [
{
tag: 'id',
name: 'Resident ID'
},
{ tag: 'env', name: 'Environmental Health' }, { tag: 'med-eval', name: 'Medical Evaluation' }
];

const Forms = (props) => {
const {
navigation, scrollViewScroll, setScrollViewScroll
Expand All @@ -28,7 +36,7 @@ const Forms = (props) => {
selectedSurveyeeId={selectedSurveyeeId}
/>
)}
{ consent === true && selectedForm === 'env' && (
{ consent === true && selectedForm !== 'id' && (
<SupplementaryForm
navigation={navigation}
selectedForm={selectedForm}
Expand All @@ -46,17 +54,30 @@ const Forms = (props) => {
{selectedForm === '' && (
<View>
<Text>Suggested next Forms</Text>
<Card onPress={() => setSelectedForm('id')}>
<Card.Title title="Resident ID" subtitle="" />
</Card>
<Card onPress={() => setSelectedForm('env')}>
<Card.Title title="Environmental History" subtitle="" />
</Card>
<View>View All Forms</View>
<ScrollView horizontal>
{puenteForms.map((form) => (
<Card key={form.tag} style={screenLayout.card} onPress={() => setSelectedForm(form.tag)}>
<Text>{form.name}</Text>
</Card>
))}
</ScrollView>
{/* <View> <Text>View All Forms</Text></View> */}
</View>
)}
</View>
);
};

const screenLayout = StyleSheet.create({
card: {
height: 90,
width: 90,
justifyContent: 'center',
alignItems: 'center',
marginHorizontal: 5,
marginVertical: 5
}

});

export default Forms;
Loading

0 comments on commit fec481a

Please sign in to comment.