c2-clinical 1.0.21 → 1.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -2,8 +2,8 @@ import GroupFormUnitsFlow from "./flow/group/GroupFormUnitsFlow";
2
2
  import ExecFormulaFlow from "./flow/on-answer/ExecFormulaFlow";
3
3
  import OnAnswerQuestionsFlow from "./flow/on-answer/OnAnswerQuestionsFlow";
4
4
  export * from "./models/enum";
5
- export * from "./models/Patient";
6
- export * from "./models/Phone";
5
+ export * from "./models/patient/Patient";
6
+ export * from "./models/patient/Phone";
7
7
  export * from "./models/File";
8
8
  export * from "./models/Account";
9
9
  export * from "./models/Default";
package/dist/index.js CHANGED
@@ -25,8 +25,8 @@ exports.ExecFormulaFlow = ExecFormulaFlow_1.default;
25
25
  const OnAnswerQuestionsFlow_1 = __importDefault(require("./flow/on-answer/OnAnswerQuestionsFlow"));
26
26
  exports.OnAnswerQuestionsFlow = OnAnswerQuestionsFlow_1.default;
27
27
  __exportStar(require("./models/enum"), exports);
28
- __exportStar(require("./models/Patient"), exports);
29
- __exportStar(require("./models/Phone"), exports);
28
+ __exportStar(require("./models/patient/Patient"), exports);
29
+ __exportStar(require("./models/patient/Phone"), exports);
30
30
  __exportStar(require("./models/File"), exports);
31
31
  __exportStar(require("./models/Account"), exports);
32
32
  __exportStar(require("./models/Default"), exports);
@@ -0,0 +1,50 @@
1
+ import { Schema, Types } from "mongoose";
2
+ import { ICity } from "./City";
3
+ export interface IAddress {
4
+ description: string;
5
+ zipCode: string;
6
+ street: string;
7
+ number: string;
8
+ complement: string;
9
+ neighborhood: string;
10
+ typeNeighborhood: string;
11
+ typeStreet: string;
12
+ city: Types.ObjectId | ICity;
13
+ }
14
+ export declare const AddressSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
15
+ _id: false;
16
+ }, {
17
+ description: string;
18
+ number?: string | null | undefined;
19
+ zipCode?: string | null | undefined;
20
+ street?: string | null | undefined;
21
+ complement?: string | null | undefined;
22
+ neighborhood?: string | null | undefined;
23
+ typeNeighborhood?: string | null | undefined;
24
+ typeStreet?: string | null | undefined;
25
+ city?: any;
26
+ }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
27
+ description: string;
28
+ number?: string | null | undefined;
29
+ zipCode?: string | null | undefined;
30
+ street?: string | null | undefined;
31
+ complement?: string | null | undefined;
32
+ neighborhood?: string | null | undefined;
33
+ typeNeighborhood?: string | null | undefined;
34
+ typeStreet?: string | null | undefined;
35
+ city?: any;
36
+ }>, {}> & import("mongoose").FlatRecord<{
37
+ description: string;
38
+ number?: string | null | undefined;
39
+ zipCode?: string | null | undefined;
40
+ street?: string | null | undefined;
41
+ complement?: string | null | undefined;
42
+ neighborhood?: string | null | undefined;
43
+ typeNeighborhood?: string | null | undefined;
44
+ typeStreet?: string | null | undefined;
45
+ city?: any;
46
+ }> & {
47
+ _id: Types.ObjectId;
48
+ } & {
49
+ __v: number;
50
+ }>;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AddressSchema = void 0;
4
+ const mongoose_1 = require("mongoose");
5
+ exports.AddressSchema = new mongoose_1.Schema({
6
+ description: { type: String, default: "Principal" },
7
+ zipCode: { type: String },
8
+ street: { type: String },
9
+ number: { type: String },
10
+ complement: { type: String },
11
+ neighborhood: { type: String },
12
+ typeNeighborhood: { type: String },
13
+ typeStreet: { type: String },
14
+ city: { type: mongoose_1.Schema.Types.ObjectId, ref: "city" }
15
+ }, {
16
+ _id: false
17
+ });
@@ -0,0 +1,34 @@
1
+ import { Schema, Types } from "mongoose";
2
+ import { IState } from "./State";
3
+ import { IDefaultAdmin } from "../Default";
4
+ export interface ICity extends IDefaultAdmin {
5
+ name: string;
6
+ abbreviation: string;
7
+ code: string;
8
+ state: Types.ObjectId | IState;
9
+ }
10
+ export declare const AdminCityModel: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
11
+ timestamps: {
12
+ createdAt: string;
13
+ updatedAt: string;
14
+ };
15
+ }, {} & {
16
+ name: string;
17
+ code: string;
18
+ state: any;
19
+ abbreviation?: string | null | undefined;
20
+ }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{} & {
21
+ name: string;
22
+ code: string;
23
+ state: any;
24
+ abbreviation?: string | null | undefined;
25
+ }>, {}> & import("mongoose").FlatRecord<{} & {
26
+ name: string;
27
+ code: string;
28
+ state: any;
29
+ abbreviation?: string | null | undefined;
30
+ }> & {
31
+ _id: Types.ObjectId;
32
+ } & {
33
+ __v: number;
34
+ }>;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AdminCityModel = void 0;
4
+ const mongoose_1 = require("mongoose");
5
+ exports.AdminCityModel = new mongoose_1.Schema({
6
+ name: { type: String, required: true },
7
+ abbreviation: { type: String },
8
+ code: { type: String, required: true },
9
+ state: { type: mongoose_1.Schema.Types.ObjectId, ref: "state", required: true }
10
+ }, {
11
+ timestamps: { createdAt: "createdAtDateTime", updatedAt: "updatedAtDateTime" }
12
+ });
13
+ exports.AdminCityModel.index({ name: 1, state: 1 }, { unique: true });
@@ -0,0 +1,247 @@
1
+ import { Schema } from "mongoose";
2
+ import { IDefault } from "../Default";
3
+ import { IPhone } from "./Phone";
4
+ import { GenreEnum } from "../enum";
5
+ import { IAddress } from "./Address";
6
+ export interface IPatientAppConfig {
7
+ accessEnable: boolean;
8
+ accessCode: string;
9
+ accessExpireDate: Date;
10
+ }
11
+ export interface IPatient extends IDefault {
12
+ fullName: string;
13
+ genre: GenreEnum;
14
+ bornDate: Date;
15
+ phones: IPhone[];
16
+ socialId: string;
17
+ email: string;
18
+ tags: string[];
19
+ active: boolean;
20
+ sendEmailAsWelcome: boolean;
21
+ appConfig: IPatientAppConfig;
22
+ addresses: IAddress[];
23
+ }
24
+ export declare const PatientAppConfigSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
25
+ _id: false;
26
+ }, {
27
+ accessEnable?: any;
28
+ accessCode?: string | null | undefined;
29
+ accessExpireDate?: NativeDate | null | undefined;
30
+ }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
31
+ accessEnable?: any;
32
+ accessCode?: string | null | undefined;
33
+ accessExpireDate?: NativeDate | null | undefined;
34
+ }>, {}> & import("mongoose").FlatRecord<{
35
+ accessEnable?: any;
36
+ accessCode?: string | null | undefined;
37
+ accessExpireDate?: NativeDate | null | undefined;
38
+ }> & {
39
+ _id: import("mongoose").Types.ObjectId;
40
+ } & {
41
+ __v: number;
42
+ }>;
43
+ export declare const PatientSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
44
+ timestamps: {
45
+ createdAt: string;
46
+ updatedAt: string;
47
+ };
48
+ }, {} & {
49
+ account: any;
50
+ active: any;
51
+ fullName: string;
52
+ bornDate: NativeDate;
53
+ phones: import("mongoose").Types.DocumentArray<{} & {
54
+ active: any;
55
+ countryCode: string;
56
+ isWhatsapp: any;
57
+ number?: string | null | undefined;
58
+ description?: string | null | undefined;
59
+ }, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {} & {
60
+ active: any;
61
+ countryCode: string;
62
+ isWhatsapp: any;
63
+ number?: string | null | undefined;
64
+ description?: string | null | undefined;
65
+ }> & {} & {
66
+ active: any;
67
+ countryCode: string;
68
+ isWhatsapp: any;
69
+ number?: string | null | undefined;
70
+ description?: string | null | undefined;
71
+ }>;
72
+ socialId: string;
73
+ tags: string[];
74
+ sendEmailAsWelcome: any;
75
+ addresses: import("mongoose").Types.DocumentArray<{
76
+ description: string;
77
+ number?: string | null | undefined;
78
+ zipCode?: string | null | undefined;
79
+ street?: string | null | undefined;
80
+ complement?: string | null | undefined;
81
+ neighborhood?: string | null | undefined;
82
+ typeNeighborhood?: string | null | undefined;
83
+ typeStreet?: string | null | undefined;
84
+ city?: any;
85
+ }, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
86
+ description: string;
87
+ number?: string | null | undefined;
88
+ zipCode?: string | null | undefined;
89
+ street?: string | null | undefined;
90
+ complement?: string | null | undefined;
91
+ neighborhood?: string | null | undefined;
92
+ typeNeighborhood?: string | null | undefined;
93
+ typeStreet?: string | null | undefined;
94
+ city?: any;
95
+ }> & {
96
+ description: string;
97
+ number?: string | null | undefined;
98
+ zipCode?: string | null | undefined;
99
+ street?: string | null | undefined;
100
+ complement?: string | null | undefined;
101
+ neighborhood?: string | null | undefined;
102
+ typeNeighborhood?: string | null | undefined;
103
+ typeStreet?: string | null | undefined;
104
+ city?: any;
105
+ }>;
106
+ email?: string | null | undefined;
107
+ genre?: string | null | undefined;
108
+ appConfig?: {
109
+ accessEnable?: any;
110
+ accessCode?: string | null | undefined;
111
+ accessExpireDate?: NativeDate | null | undefined;
112
+ } | null | undefined;
113
+ }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{} & {
114
+ account: any;
115
+ active: any;
116
+ fullName: string;
117
+ bornDate: NativeDate;
118
+ phones: import("mongoose").Types.DocumentArray<{} & {
119
+ active: any;
120
+ countryCode: string;
121
+ isWhatsapp: any;
122
+ number?: string | null | undefined;
123
+ description?: string | null | undefined;
124
+ }, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {} & {
125
+ active: any;
126
+ countryCode: string;
127
+ isWhatsapp: any;
128
+ number?: string | null | undefined;
129
+ description?: string | null | undefined;
130
+ }> & {} & {
131
+ active: any;
132
+ countryCode: string;
133
+ isWhatsapp: any;
134
+ number?: string | null | undefined;
135
+ description?: string | null | undefined;
136
+ }>;
137
+ socialId: string;
138
+ tags: string[];
139
+ sendEmailAsWelcome: any;
140
+ addresses: import("mongoose").Types.DocumentArray<{
141
+ description: string;
142
+ number?: string | null | undefined;
143
+ zipCode?: string | null | undefined;
144
+ street?: string | null | undefined;
145
+ complement?: string | null | undefined;
146
+ neighborhood?: string | null | undefined;
147
+ typeNeighborhood?: string | null | undefined;
148
+ typeStreet?: string | null | undefined;
149
+ city?: any;
150
+ }, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
151
+ description: string;
152
+ number?: string | null | undefined;
153
+ zipCode?: string | null | undefined;
154
+ street?: string | null | undefined;
155
+ complement?: string | null | undefined;
156
+ neighborhood?: string | null | undefined;
157
+ typeNeighborhood?: string | null | undefined;
158
+ typeStreet?: string | null | undefined;
159
+ city?: any;
160
+ }> & {
161
+ description: string;
162
+ number?: string | null | undefined;
163
+ zipCode?: string | null | undefined;
164
+ street?: string | null | undefined;
165
+ complement?: string | null | undefined;
166
+ neighborhood?: string | null | undefined;
167
+ typeNeighborhood?: string | null | undefined;
168
+ typeStreet?: string | null | undefined;
169
+ city?: any;
170
+ }>;
171
+ email?: string | null | undefined;
172
+ genre?: string | null | undefined;
173
+ appConfig?: {
174
+ accessEnable?: any;
175
+ accessCode?: string | null | undefined;
176
+ accessExpireDate?: NativeDate | null | undefined;
177
+ } | null | undefined;
178
+ }>, {}> & import("mongoose").FlatRecord<{} & {
179
+ account: any;
180
+ active: any;
181
+ fullName: string;
182
+ bornDate: NativeDate;
183
+ phones: import("mongoose").Types.DocumentArray<{} & {
184
+ active: any;
185
+ countryCode: string;
186
+ isWhatsapp: any;
187
+ number?: string | null | undefined;
188
+ description?: string | null | undefined;
189
+ }, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {} & {
190
+ active: any;
191
+ countryCode: string;
192
+ isWhatsapp: any;
193
+ number?: string | null | undefined;
194
+ description?: string | null | undefined;
195
+ }> & {} & {
196
+ active: any;
197
+ countryCode: string;
198
+ isWhatsapp: any;
199
+ number?: string | null | undefined;
200
+ description?: string | null | undefined;
201
+ }>;
202
+ socialId: string;
203
+ tags: string[];
204
+ sendEmailAsWelcome: any;
205
+ addresses: import("mongoose").Types.DocumentArray<{
206
+ description: string;
207
+ number?: string | null | undefined;
208
+ zipCode?: string | null | undefined;
209
+ street?: string | null | undefined;
210
+ complement?: string | null | undefined;
211
+ neighborhood?: string | null | undefined;
212
+ typeNeighborhood?: string | null | undefined;
213
+ typeStreet?: string | null | undefined;
214
+ city?: any;
215
+ }, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
216
+ description: string;
217
+ number?: string | null | undefined;
218
+ zipCode?: string | null | undefined;
219
+ street?: string | null | undefined;
220
+ complement?: string | null | undefined;
221
+ neighborhood?: string | null | undefined;
222
+ typeNeighborhood?: string | null | undefined;
223
+ typeStreet?: string | null | undefined;
224
+ city?: any;
225
+ }> & {
226
+ description: string;
227
+ number?: string | null | undefined;
228
+ zipCode?: string | null | undefined;
229
+ street?: string | null | undefined;
230
+ complement?: string | null | undefined;
231
+ neighborhood?: string | null | undefined;
232
+ typeNeighborhood?: string | null | undefined;
233
+ typeStreet?: string | null | undefined;
234
+ city?: any;
235
+ }>;
236
+ email?: string | null | undefined;
237
+ genre?: string | null | undefined;
238
+ appConfig?: {
239
+ accessEnable?: any;
240
+ accessCode?: string | null | undefined;
241
+ accessExpireDate?: NativeDate | null | undefined;
242
+ } | null | undefined;
243
+ }> & {
244
+ _id: import("mongoose").Types.ObjectId;
245
+ } & {
246
+ __v: number;
247
+ }>;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PatientSchema = exports.PatientAppConfigSchema = void 0;
4
+ const mongoose_1 = require("mongoose");
5
+ const Phone_1 = require("./Phone");
6
+ const enum_1 = require("../enum");
7
+ const Address_1 = require("./Address");
8
+ exports.PatientAppConfigSchema = new mongoose_1.Schema({
9
+ accessEnable: { type: Boolean },
10
+ accessCode: { type: String },
11
+ accessExpireDate: { type: Date }
12
+ }, {
13
+ _id: false
14
+ });
15
+ exports.PatientSchema = new mongoose_1.Schema({
16
+ account: { type: mongoose_1.Schema.Types.ObjectId, ref: "account", required: true },
17
+ genre: { type: String, enum: enum_1.GenreEnum },
18
+ fullName: { type: String, required: true },
19
+ bornDate: { type: Date, required: true },
20
+ phones: { type: [Phone_1.PhoneSchema] },
21
+ socialId: { type: String, required: true },
22
+ email: { type: String },
23
+ tags: { type: [String] },
24
+ active: { type: Boolean, default: true },
25
+ sendEmailAsWelcome: { type: Boolean, default: false },
26
+ appConfig: { type: exports.PatientAppConfigSchema },
27
+ addresses: { type: [Address_1.AddressSchema] }
28
+ }, {
29
+ timestamps: {
30
+ createdAt: "createdAtDateTime",
31
+ updatedAt: "updatedAtDateTime"
32
+ }
33
+ });
34
+ exports.PatientSchema.index({ fullName: 1 }, { unique: false });
35
+ exports.PatientSchema.index({ account: 1 }, { unique: false });
36
+ exports.PatientSchema.index({ account: 1, socialId: 1 }, { unique: true });
@@ -0,0 +1,37 @@
1
+ import * as mongoose from "mongoose";
2
+ export interface IPhone {
3
+ description: string;
4
+ countryCode: string;
5
+ number: string;
6
+ active: boolean;
7
+ isWhatsapp: boolean;
8
+ }
9
+ export declare const PhoneSchema: mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
10
+ timestamps: {
11
+ createdAt: string;
12
+ updatedAt: string;
13
+ };
14
+ _id: false;
15
+ }, {} & {
16
+ active: any;
17
+ countryCode: string;
18
+ isWhatsapp: any;
19
+ number?: string | null | undefined;
20
+ description?: string | null | undefined;
21
+ }, mongoose.Document<unknown, {}, mongoose.FlatRecord<{} & {
22
+ active: any;
23
+ countryCode: string;
24
+ isWhatsapp: any;
25
+ number?: string | null | undefined;
26
+ description?: string | null | undefined;
27
+ }>, {}> & mongoose.FlatRecord<{} & {
28
+ active: any;
29
+ countryCode: string;
30
+ isWhatsapp: any;
31
+ number?: string | null | undefined;
32
+ description?: string | null | undefined;
33
+ }> & {
34
+ _id: mongoose.Types.ObjectId;
35
+ } & {
36
+ __v: number;
37
+ }>;
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.PhoneSchema = void 0;
37
+ const mongoose = __importStar(require("mongoose"));
38
+ exports.PhoneSchema = new mongoose.Schema({
39
+ description: { type: String },
40
+ countryCode: { type: String, default: "+55" },
41
+ number: { type: String },
42
+ isWhatsapp: { type: Boolean, default: true },
43
+ active: { type: Boolean, default: true }
44
+ }, {
45
+ timestamps: { createdAt: "createdAtDateTime", updatedAt: "updatedAtDateTime" },
46
+ _id: false
47
+ });
@@ -0,0 +1,42 @@
1
+ import { Schema } from "mongoose";
2
+ import { IDefaultAdmin } from "../Default";
3
+ export interface IState extends IDefaultAdmin {
4
+ sbaumId: string;
5
+ name: string;
6
+ abbreviation: string;
7
+ code: string;
8
+ countryName: string;
9
+ countryCode: string;
10
+ countryAbbreviation: string;
11
+ }
12
+ export declare const StateSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
13
+ timestamps: {
14
+ createdAt: string;
15
+ updatedAt: string;
16
+ };
17
+ }, {} & {
18
+ name: string;
19
+ code: string;
20
+ countryCode: string;
21
+ abbreviation: string;
22
+ countryName: string;
23
+ countryAbbreviation: string;
24
+ }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{} & {
25
+ name: string;
26
+ code: string;
27
+ countryCode: string;
28
+ abbreviation: string;
29
+ countryName: string;
30
+ countryAbbreviation: string;
31
+ }>, {}> & import("mongoose").FlatRecord<{} & {
32
+ name: string;
33
+ code: string;
34
+ countryCode: string;
35
+ abbreviation: string;
36
+ countryName: string;
37
+ countryAbbreviation: string;
38
+ }> & {
39
+ _id: import("mongoose").Types.ObjectId;
40
+ } & {
41
+ __v: number;
42
+ }>;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StateSchema = void 0;
4
+ const mongoose_1 = require("mongoose");
5
+ exports.StateSchema = new mongoose_1.Schema({
6
+ name: { type: String, required: true },
7
+ abbreviation: { type: String, required: true },
8
+ code: { type: String, required: true },
9
+ countryName: { type: String, required: true },
10
+ countryCode: { type: String, required: true },
11
+ countryAbbreviation: { type: String, required: true }
12
+ }, {
13
+ timestamps: { createdAt: "createdAtDateTime", updatedAt: "updatedAtDateTime" }
14
+ });
15
+ exports.StateSchema.index({ name: 1, countryCode: 1 }, { unique: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-clinical",
3
- "version": "1.0.21",
3
+ "version": "1.0.23",
4
4
  "description": "Biblioteca Typescript para API NodeJS",
5
5
  "repository": "https://github.com/cabralsilva/c2-clinical.git",
6
6
  "author": "Daniel Cabral <cabralconsultoriaemsoftware@gmail.com>",