@@ -7,14 +7,44 @@ import {
7
7
import { DEFAULT_SEEDS } from '@codetanzania/ewea-common' ;
8
8
import { compact } from '@lykmapipo/common' ;
9
9
import { Point } from 'mongoose-geojson-schemas' ;
10
- import { ObjectId , createSubSchema } from '@lykmapipo/mongoose-common' ;
10
+ import { ObjectId , Mixed , createSubSchema } from '@lykmapipo/mongoose-common' ;
11
11
import { Predefine } from '@lykmapipo/predefine' ;
12
12
13
13
import {
14
14
AUTOPOPULATE_OPTION_PREDEFINE ,
15
15
AUTOPOPULATE_OPTION_AREA ,
16
16
} from '../internals' ;
17
17
18
+ import { follower } from './parties.schema' ;
19
+ import { followedAt } from './dates.schema' ;
20
+ import { outcome , remarks } from './base.schema' ;
21
+
22
+ /**
23
+ * @name properties
24
+ * @description A map of key value pairs to allow to associate
25
+ * other meaningful information to a case.
26
+ *
27
+ * @type {object }
28
+ * @property {object } type - schema(data) type
29
+ * @property {object } fake - fake data generator options
30
+ *
31
+ * @since 0.2.0
32
+ * @version 0.1.0
33
+ * @instance
34
+ * @example
35
+ * {
36
+ * "population": {
37
+ * "male": 1700000,
38
+ * "female": 2700000
39
+ * }
40
+ * }
41
+ */
42
+ export const properties = {
43
+ type : Map ,
44
+ of : Mixed ,
45
+ fake : ( f ) => f . helpers . createTransaction ( ) ,
46
+ } ;
47
+
18
48
/**
19
49
* @name name
20
50
* @description Full name name of the party(i.e individual).
@@ -521,3 +551,40 @@ export const victim = createSubSchema({
521
551
area,
522
552
nextOfKin,
523
553
} ) ;
554
+
555
+ /**
556
+ * @name victim
557
+ * @description A party(i.e patient or victim) whom a case is for.
558
+ *
559
+ * @type {object }
560
+ * @property {string } referral - Valid referral number
561
+ * @property {string } pcr - Valid patient care number
562
+ * @property {string } name - Full name of the victim
563
+ * @property {string } mobile - Mobile phone number of the victim
564
+ * @property {object } gender - Gender of the victim
565
+ * @property {number } age - Age of the victim
566
+ * @property {number } weight - Weight of the victim
567
+ * @property {object } occupation - Occupation of the victim
568
+ * @property {object } nationality - Nationality of the victim
569
+ * @property {string } address - Address of the victim
570
+ *
571
+ * @author lally elias <lallyelias87@gmail.com>
572
+ * @since 0.1.0
573
+ * @version 0.2.0
574
+ * @instance
575
+ * @example
576
+ * {
577
+ * follower: {_id: "5bcda2c073dd0700048fb846", name: "Jane Doe" }
578
+ * followedAt: '2018-10-19T07:55:32.831Z',
579
+ * symptoms: { cough: 5 },
580
+ * outcome: 'Hospital',
581
+ * remarks: 'Handled'
582
+ * }
583
+ */
584
+ export const followup = createSubSchema ( {
585
+ follower,
586
+ followedAt,
587
+ symptoms : properties ,
588
+ outcome,
589
+ remarks,
590
+ } ) ;
0 commit comments