c2-clinical 1.0.9 → 1.0.11
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/config/const.d.ts +1 -0
- package/dist/config/const.js +4 -0
- package/dist/flow/group/GroupFormUnitsFlow.d.ts +7 -0
- package/dist/flow/group/GroupFormUnitsFlow.js +17 -0
- package/dist/flow/group/item/BuildTreeFlowItem.d.ts +7 -0
- package/dist/flow/group/item/BuildTreeFlowItem.js +31 -0
- package/dist/flow/group/item/GetEnablesFormUnitsFlowItem.d.ts +7 -0
- package/dist/flow/group/item/GetEnablesFormUnitsFlowItem.js +27 -0
- package/dist/flow/item/BuildFormulaFlowItem.d.ts +7 -0
- package/dist/flow/item/BuildFormulaFlowItem.js +36 -0
- package/dist/flow/item/BuildFormulaMetsFlowItem.d.ts +7 -0
- package/dist/flow/item/BuildFormulaMetsFlowItem.js +46 -0
- package/dist/flow/item/ExecFormulaFlowItem.d.ts +5 -0
- package/dist/flow/item/ExecFormulaFlowItem.js +15 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +6 -0
- package/dist/models/File.d.ts +6 -6
- package/dist/models/IAnswer.d.ts +8 -0
- package/dist/models/IAnswer.js +2 -0
- package/dist/models/IGroup.d.ts +18 -0
- package/dist/models/IGroup.js +2 -0
- package/dist/models/form/Form.d.ts +3 -3
- package/dist/models/form/FormUnit.d.ts +16 -15
- package/dist/models/met-activity/IMetActivity.d.ts +13 -0
- package/dist/models/met-activity/IMetActivity.js +9 -0
- package/dist/models/met-activity/IMetActivityPatient.d.ts +20 -0
- package/dist/models/met-activity/IMetActivityPatient.js +2 -0
- package/dist/models/qpc/QPC.d.ts +6 -6
- package/dist/models/qpc/QPCAnswer.d.ts +50 -64
- package/dist/models/qpc/QPCAnswer.js +1 -10
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MET_ACTIVITIES = "${MET_ACTIVITIES}";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IFormUnit } from "../../models/form/FormUnit";
|
|
2
|
+
import { IAnswer } from "../../models/IAnswer";
|
|
3
|
+
declare class GroupFormUnitsFlow {
|
|
4
|
+
execute(formUnits: IFormUnit[], answers: IAnswer[]): IFormUnit[];
|
|
5
|
+
}
|
|
6
|
+
declare const _default: GroupFormUnitsFlow;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const BuildTreeFlowItem_1 = __importDefault(require("./item/BuildTreeFlowItem"));
|
|
7
|
+
const GetEnablesFormUnitsFlowItem_1 = __importDefault(require("./item/GetEnablesFormUnitsFlowItem"));
|
|
8
|
+
class GroupFormUnitsFlow {
|
|
9
|
+
execute(formUnits, answers) {
|
|
10
|
+
const questionsEnableds = GetEnablesFormUnitsFlowItem_1.default.execute(formUnits, answers);
|
|
11
|
+
const questionsWithOrganizedChilds = BuildTreeFlowItem_1.default.execute(questionsEnableds);
|
|
12
|
+
// const questionsGrouped = GroupListFlowItem.exec(questionsWithOrganizedChilds, "reference.group._id", "reference.group")
|
|
13
|
+
// const groups = BuildGroupsDTOFlow.exec(questionsGrouped, questionsAnswereds);
|
|
14
|
+
return questionsWithOrganizedChilds;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.default = new GroupFormUnitsFlow();
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
class BuildTreeFlowItem {
|
|
4
|
+
execute(questions) {
|
|
5
|
+
//extrai os elements raiz (sem parent)
|
|
6
|
+
const rootFormUnit = questions
|
|
7
|
+
.filter((q) => !q.parent)
|
|
8
|
+
.map((q) => {
|
|
9
|
+
return {
|
|
10
|
+
...q,
|
|
11
|
+
children: []
|
|
12
|
+
};
|
|
13
|
+
});
|
|
14
|
+
//extrai os elements que tem algum parent
|
|
15
|
+
const children = questions.filter((q) => !!q.parent);
|
|
16
|
+
rootFormUnit?.forEach((q) => {
|
|
17
|
+
this.iterate(q, children);
|
|
18
|
+
});
|
|
19
|
+
return rootFormUnit;
|
|
20
|
+
}
|
|
21
|
+
iterate(parent, children) {
|
|
22
|
+
parent.children = children.filter((child) => child.parent.toString() === parent._id.toString());
|
|
23
|
+
parent.children.sort((a, b) => a.line - b.line);
|
|
24
|
+
if (parent.children.length > 0) {
|
|
25
|
+
parent.children.forEach((parentPossible) => {
|
|
26
|
+
this.iterate(parentPossible, children);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.default = new BuildTreeFlowItem();
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IFormUnit } from "../../../models/form/FormUnit";
|
|
2
|
+
import { IAnswer } from "../../../models/IAnswer";
|
|
3
|
+
declare class GetEnablesFormUnitsFlowItem {
|
|
4
|
+
execute(formUnits: IFormUnit[], answers: IAnswer[]): IFormUnit[];
|
|
5
|
+
}
|
|
6
|
+
declare const _default: GetEnablesFormUnitsFlowItem;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const BuildFormulaFlowItem_1 = __importDefault(require("../../item/BuildFormulaFlowItem"));
|
|
7
|
+
const ExecFormulaFlowItem_1 = __importDefault(require("../../item/ExecFormulaFlowItem"));
|
|
8
|
+
class GetEnablesFormUnitsFlowItem {
|
|
9
|
+
execute(formUnits, answers) {
|
|
10
|
+
return formUnits?.filter((unit) => {
|
|
11
|
+
if (!unit.show)
|
|
12
|
+
return false;
|
|
13
|
+
if (!unit.active)
|
|
14
|
+
return false;
|
|
15
|
+
if (!unit.formulaToEnable)
|
|
16
|
+
return true;
|
|
17
|
+
//MONTAGEM DA FORMULA COM OS VALORES
|
|
18
|
+
let formulaToEnable = unit.formulaToEnable;
|
|
19
|
+
formulaToEnable = BuildFormulaFlowItem_1.default.execute(answers, formulaToEnable ?? "");
|
|
20
|
+
//TENTAR EXECUTAR A FORMULA
|
|
21
|
+
let enable = false;
|
|
22
|
+
enable = ExecFormulaFlowItem_1.default.exec(false, formulaToEnable);
|
|
23
|
+
return enable;
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.default = new GetEnablesFormUnitsFlowItem();
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IAnswer } from "../../models/IAnswer";
|
|
2
|
+
import { IMetActivityPatient } from "../../models/met-activity/IMetActivityPatient";
|
|
3
|
+
declare class BuildFormulaFlowItem {
|
|
4
|
+
execute(answers: IAnswer[], formula: string, metsActivities?: IMetActivityPatient[], replaceDefault?: string): string;
|
|
5
|
+
}
|
|
6
|
+
declare const _default: BuildFormulaFlowItem;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const BuildFormulaMetsFlowItem_1 = __importDefault(require("./BuildFormulaMetsFlowItem"));
|
|
7
|
+
class BuildFormulaFlowItem {
|
|
8
|
+
execute(answers, formula, metsActivities, replaceDefault) {
|
|
9
|
+
if (!formula) {
|
|
10
|
+
console.error("formula is undefined");
|
|
11
|
+
return formula;
|
|
12
|
+
}
|
|
13
|
+
const formulaBefore = formula;
|
|
14
|
+
const matches = formula.match(/\$\{(?!\{)([^}]+)\}/g) ?? []; // padrao regex: ${ANYTHING}
|
|
15
|
+
const variables = [...new Set(matches)];
|
|
16
|
+
for (const variable of variables) {
|
|
17
|
+
const variablePure = variable.match(/\$\{([^}]+)\}/) ?? [];
|
|
18
|
+
const questionAnswered = answers.find((a) => a.reference.code === variablePure[1]);
|
|
19
|
+
if (questionAnswered?.answer !== undefined && questionAnswered?.answer !== "") {
|
|
20
|
+
formula = formula.replaceAll(variable, questionAnswered?.answer);
|
|
21
|
+
}
|
|
22
|
+
if (formula.includes(variable) && replaceDefault) {
|
|
23
|
+
formula = formula.replaceAll(variable, replaceDefault);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
formula = formula.replaceAll(/\$\{\{([^}]+)\}\}/g, (_, match) => `\$\{${match}\}`);
|
|
27
|
+
if (metsActivities) {
|
|
28
|
+
formula = BuildFormulaMetsFlowItem_1.default.exec(answers, formula, metsActivities);
|
|
29
|
+
}
|
|
30
|
+
if (formula !== formulaBefore) {
|
|
31
|
+
return this.execute(answers, formula, metsActivities, replaceDefault);
|
|
32
|
+
}
|
|
33
|
+
return formula;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.default = new BuildFormulaFlowItem();
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IAnswer } from "../../models/IAnswer";
|
|
2
|
+
import { IMetActivityPatient } from "../../models/met-activity/IMetActivityPatient";
|
|
3
|
+
declare class BuildFormulaMetsFlowItem {
|
|
4
|
+
exec(answers: IAnswer[], formula: string, metsActivities: IMetActivityPatient[]): string;
|
|
5
|
+
}
|
|
6
|
+
declare const _default: BuildFormulaMetsFlowItem;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const const_1 = require("../../config/const");
|
|
4
|
+
class BuildFormulaMetsFlowItem {
|
|
5
|
+
exec(answers, formula, metsActivities) {
|
|
6
|
+
if (!formula) {
|
|
7
|
+
return formula;
|
|
8
|
+
}
|
|
9
|
+
if (!formula.includes(const_1.MET_ACTIVITIES)) {
|
|
10
|
+
return formula;
|
|
11
|
+
}
|
|
12
|
+
const matches = formula.match(/\$\{([^}]+)\}/g) ?? []; // padrao regex: ${ANYTHING}
|
|
13
|
+
const variables = [...new Set(matches)];
|
|
14
|
+
for (const variable of variables) {
|
|
15
|
+
const variablePure = variable.match(/\$\{([^}]+)\}/) ?? [];
|
|
16
|
+
const questionAnswered = answers.find((aq) => aq.reference.code === variablePure[1]);
|
|
17
|
+
if (questionAnswered?.answer !== undefined && questionAnswered?.answer !== "") {
|
|
18
|
+
formula = formula.replaceAll(variable, questionAnswered?.answer);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
if (formula.includes(const_1.MET_ACTIVITIES)) {
|
|
22
|
+
const metsActivitiesAux = metsActivities?.map((ma) => {
|
|
23
|
+
return {
|
|
24
|
+
met: { metValue: ma.met.metValue },
|
|
25
|
+
sundayTime: ma.sundayTime,
|
|
26
|
+
sundayTimeCoefficient: ma.sundayTimeCoefficient,
|
|
27
|
+
mondayTime: ma.mondayTime,
|
|
28
|
+
mondayTimeCoefficient: ma.mondayTimeCoefficient,
|
|
29
|
+
tuesdayTime: ma.tuesdayTime,
|
|
30
|
+
tuesdayTimeCoefficient: ma.tuesdayTimeCoefficient,
|
|
31
|
+
wednesdayTime: ma.wednesdayTime,
|
|
32
|
+
wednesdayTimeCoefficient: ma.wednesdayTimeCoefficient,
|
|
33
|
+
thursdayTime: ma.thursdayTime,
|
|
34
|
+
thursdayTimeCoefficient: ma.thursdayTimeCoefficient,
|
|
35
|
+
fridayTime: ma.fridayTime,
|
|
36
|
+
fridayTimeCoefficient: ma.fridayTimeCoefficient,
|
|
37
|
+
saturdayTime: ma.saturdayTime,
|
|
38
|
+
saturdayTimeCoefficient: ma.saturdayTimeCoefficient
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
formula = formula.replaceAll(const_1.MET_ACTIVITIES, JSON.stringify(metsActivitiesAux).replace(/"/g, "'"));
|
|
42
|
+
}
|
|
43
|
+
return formula;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.default = new BuildFormulaMetsFlowItem();
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
class ExecFormulaFlowItem {
|
|
4
|
+
exec(defaultResult, formula) {
|
|
5
|
+
let result = defaultResult;
|
|
6
|
+
try {
|
|
7
|
+
result = eval(formula);
|
|
8
|
+
}
|
|
9
|
+
catch (error) {
|
|
10
|
+
result = defaultResult;
|
|
11
|
+
}
|
|
12
|
+
return result;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.default = new ExecFormulaFlowItem();
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import GroupFormUnitsFlow from "./flow/group/GroupFormUnitsFlow";
|
|
1
2
|
export * from "./models/File";
|
|
2
3
|
export * from "./models/IAccount";
|
|
3
4
|
export * from "./models/IDefault";
|
|
@@ -5,3 +6,4 @@ export * from "./models/form/Form";
|
|
|
5
6
|
export * from "./models/form/FormUnit";
|
|
6
7
|
export * from "./models/qpc/QPC";
|
|
7
8
|
export * from "./models/qpc/QPCAnswer";
|
|
9
|
+
export { GroupFormUnitsFlow };
|
package/dist/index.js
CHANGED
|
@@ -13,7 +13,13 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
13
13
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
16
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.GroupFormUnitsFlow = void 0;
|
|
21
|
+
const GroupFormUnitsFlow_1 = __importDefault(require("./flow/group/GroupFormUnitsFlow"));
|
|
22
|
+
exports.GroupFormUnitsFlow = GroupFormUnitsFlow_1.default;
|
|
17
23
|
__exportStar(require("./models/File"), exports);
|
|
18
24
|
__exportStar(require("./models/IAccount"), exports);
|
|
19
25
|
__exportStar(require("./models/IDefault"), exports);
|
package/dist/models/File.d.ts
CHANGED
|
@@ -13,20 +13,20 @@ export declare const FileSchema: Schema<any, import("mongoose").Model<any, any,
|
|
|
13
13
|
updatedAt: string;
|
|
14
14
|
};
|
|
15
15
|
}, {} & {
|
|
16
|
-
contentType: string;
|
|
17
16
|
description: string;
|
|
18
|
-
|
|
17
|
+
contentType: string;
|
|
19
18
|
url?: string | null | undefined;
|
|
19
|
+
format?: string | null | undefined;
|
|
20
20
|
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{} & {
|
|
21
|
-
contentType: string;
|
|
22
21
|
description: string;
|
|
23
|
-
|
|
22
|
+
contentType: string;
|
|
24
23
|
url?: string | null | undefined;
|
|
24
|
+
format?: string | null | undefined;
|
|
25
25
|
}>, {}> & import("mongoose").FlatRecord<{} & {
|
|
26
|
-
contentType: string;
|
|
27
26
|
description: string;
|
|
28
|
-
|
|
27
|
+
contentType: string;
|
|
29
28
|
url?: string | null | undefined;
|
|
29
|
+
format?: string | null | undefined;
|
|
30
30
|
}> & {
|
|
31
31
|
_id: import("mongoose").Types.ObjectId;
|
|
32
32
|
} & {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IFormUnit, IRequestGraphicData, IValidationQuestion } from "./form/FormUnit";
|
|
2
|
+
import { IDefault } from "./IDefault";
|
|
3
|
+
export interface IAnswer extends IDefault {
|
|
4
|
+
reference: IFormUnit;
|
|
5
|
+
validations: IValidationQuestion[];
|
|
6
|
+
requestGraphicData: IRequestGraphicData[];
|
|
7
|
+
answer: any;
|
|
8
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Types } from "mongoose";
|
|
2
|
+
import { IFormUnit } from "./form/FormUnit";
|
|
3
|
+
export interface IGroup {
|
|
4
|
+
_id: undefined | string | Types.ObjectId;
|
|
5
|
+
line: number;
|
|
6
|
+
description: undefined | string;
|
|
7
|
+
lines: ILineQuestionsOrGroup[];
|
|
8
|
+
type: "GROUP";
|
|
9
|
+
groupOrigin?: IFormUnit;
|
|
10
|
+
}
|
|
11
|
+
export interface ILineQuestionsOrGroup {
|
|
12
|
+
line: number;
|
|
13
|
+
type: "GROUP" | "QUESTIONS";
|
|
14
|
+
questions?: (IFormUnit & {
|
|
15
|
+
childs: IGroup[];
|
|
16
|
+
})[];
|
|
17
|
+
group?: IGroup;
|
|
18
|
+
}
|
|
@@ -40,8 +40,8 @@ export declare const FormSchema: Schema<any, import("mongoose").Model<any, any,
|
|
|
40
40
|
type: string;
|
|
41
41
|
category: string;
|
|
42
42
|
owner: string;
|
|
43
|
-
description?: string | null | undefined;
|
|
44
43
|
account?: any;
|
|
44
|
+
description?: string | null | undefined;
|
|
45
45
|
observation?: string | null | undefined;
|
|
46
46
|
content?: string | null | undefined;
|
|
47
47
|
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{} & {
|
|
@@ -49,8 +49,8 @@ export declare const FormSchema: Schema<any, import("mongoose").Model<any, any,
|
|
|
49
49
|
type: string;
|
|
50
50
|
category: string;
|
|
51
51
|
owner: string;
|
|
52
|
-
description?: string | null | undefined;
|
|
53
52
|
account?: any;
|
|
53
|
+
description?: string | null | undefined;
|
|
54
54
|
observation?: string | null | undefined;
|
|
55
55
|
content?: string | null | undefined;
|
|
56
56
|
}>, {}> & import("mongoose").FlatRecord<{} & {
|
|
@@ -58,8 +58,8 @@ export declare const FormSchema: Schema<any, import("mongoose").Model<any, any,
|
|
|
58
58
|
type: string;
|
|
59
59
|
category: string;
|
|
60
60
|
owner: string;
|
|
61
|
-
description?: string | null | undefined;
|
|
62
61
|
account?: any;
|
|
62
|
+
description?: string | null | undefined;
|
|
63
63
|
observation?: string | null | undefined;
|
|
64
64
|
content?: string | null | undefined;
|
|
65
65
|
}> & {
|
|
@@ -92,6 +92,7 @@ export interface IFormUnit extends IDefault {
|
|
|
92
92
|
required: boolean;
|
|
93
93
|
graphicData: any;
|
|
94
94
|
requestGraphicData: IRequestGraphicData[];
|
|
95
|
+
children?: IFormUnit[];
|
|
95
96
|
}
|
|
96
97
|
export interface IQuestionOption {
|
|
97
98
|
sequence: number;
|
|
@@ -113,18 +114,18 @@ export interface IRequestGraphicData {
|
|
|
113
114
|
export declare const RequestGraphicDataSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
114
115
|
_id: false;
|
|
115
116
|
}, {
|
|
116
|
-
url: string;
|
|
117
117
|
method: string;
|
|
118
|
+
url: string;
|
|
118
119
|
body?: any;
|
|
119
120
|
dataset?: any;
|
|
120
121
|
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
121
|
-
url: string;
|
|
122
122
|
method: string;
|
|
123
|
+
url: string;
|
|
123
124
|
body?: any;
|
|
124
125
|
dataset?: any;
|
|
125
126
|
}>, {}> & import("mongoose").FlatRecord<{
|
|
126
|
-
url: string;
|
|
127
127
|
method: string;
|
|
128
|
+
url: string;
|
|
128
129
|
body?: any;
|
|
129
130
|
dataset?: any;
|
|
130
131
|
}> & {
|
|
@@ -249,23 +250,23 @@ export declare const FormUnitSchema: Schema<any, import("mongoose").Model<any, a
|
|
|
249
250
|
show: any;
|
|
250
251
|
readOnly: any;
|
|
251
252
|
requestGraphicData: Types.DocumentArray<{
|
|
252
|
-
url: string;
|
|
253
253
|
method: string;
|
|
254
|
+
url: string;
|
|
254
255
|
body?: any;
|
|
255
256
|
dataset?: any;
|
|
256
257
|
}, Types.Subdocument<Types.ObjectId, any, {
|
|
257
|
-
url: string;
|
|
258
258
|
method: string;
|
|
259
|
+
url: string;
|
|
259
260
|
body?: any;
|
|
260
261
|
dataset?: any;
|
|
261
262
|
}> & {
|
|
262
|
-
url: string;
|
|
263
263
|
method: string;
|
|
264
|
+
url: string;
|
|
264
265
|
body?: any;
|
|
265
266
|
dataset?: any;
|
|
266
267
|
}>;
|
|
267
|
-
description?: string | null | undefined;
|
|
268
268
|
account?: any;
|
|
269
|
+
description?: string | null | undefined;
|
|
269
270
|
reference?: any;
|
|
270
271
|
example?: string | null | undefined;
|
|
271
272
|
parent?: any;
|
|
@@ -331,23 +332,23 @@ export declare const FormUnitSchema: Schema<any, import("mongoose").Model<any, a
|
|
|
331
332
|
show: any;
|
|
332
333
|
readOnly: any;
|
|
333
334
|
requestGraphicData: Types.DocumentArray<{
|
|
334
|
-
url: string;
|
|
335
335
|
method: string;
|
|
336
|
+
url: string;
|
|
336
337
|
body?: any;
|
|
337
338
|
dataset?: any;
|
|
338
339
|
}, Types.Subdocument<Types.ObjectId, any, {
|
|
339
|
-
url: string;
|
|
340
340
|
method: string;
|
|
341
|
+
url: string;
|
|
341
342
|
body?: any;
|
|
342
343
|
dataset?: any;
|
|
343
344
|
}> & {
|
|
344
|
-
url: string;
|
|
345
345
|
method: string;
|
|
346
|
+
url: string;
|
|
346
347
|
body?: any;
|
|
347
348
|
dataset?: any;
|
|
348
349
|
}>;
|
|
349
|
-
description?: string | null | undefined;
|
|
350
350
|
account?: any;
|
|
351
|
+
description?: string | null | undefined;
|
|
351
352
|
reference?: any;
|
|
352
353
|
example?: string | null | undefined;
|
|
353
354
|
parent?: any;
|
|
@@ -413,23 +414,23 @@ export declare const FormUnitSchema: Schema<any, import("mongoose").Model<any, a
|
|
|
413
414
|
show: any;
|
|
414
415
|
readOnly: any;
|
|
415
416
|
requestGraphicData: Types.DocumentArray<{
|
|
416
|
-
url: string;
|
|
417
417
|
method: string;
|
|
418
|
+
url: string;
|
|
418
419
|
body?: any;
|
|
419
420
|
dataset?: any;
|
|
420
421
|
}, Types.Subdocument<Types.ObjectId, any, {
|
|
421
|
-
url: string;
|
|
422
422
|
method: string;
|
|
423
|
+
url: string;
|
|
423
424
|
body?: any;
|
|
424
425
|
dataset?: any;
|
|
425
426
|
}> & {
|
|
426
|
-
url: string;
|
|
427
427
|
method: string;
|
|
428
|
+
url: string;
|
|
428
429
|
body?: any;
|
|
429
430
|
dataset?: any;
|
|
430
431
|
}>;
|
|
431
|
-
description?: string | null | undefined;
|
|
432
432
|
account?: any;
|
|
433
|
+
description?: string | null | undefined;
|
|
433
434
|
reference?: any;
|
|
434
435
|
example?: string | null | undefined;
|
|
435
436
|
parent?: any;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IDefaultAdmin } from "../IDefault";
|
|
2
|
+
export declare enum MetTargetCondition {
|
|
3
|
+
ADULT = "ADULT",
|
|
4
|
+
OLD_ADULT = "OLD_ADULT",
|
|
5
|
+
WHEELCHAIR = "WHEELCHAIR"
|
|
6
|
+
}
|
|
7
|
+
export interface IMetActivity extends IDefaultAdmin {
|
|
8
|
+
activityName: string;
|
|
9
|
+
activityDescription: string;
|
|
10
|
+
activityCode: string;
|
|
11
|
+
metValue: number;
|
|
12
|
+
targetCondition: MetTargetCondition;
|
|
13
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MetTargetCondition = void 0;
|
|
4
|
+
var MetTargetCondition;
|
|
5
|
+
(function (MetTargetCondition) {
|
|
6
|
+
MetTargetCondition["ADULT"] = "ADULT";
|
|
7
|
+
MetTargetCondition["OLD_ADULT"] = "OLD_ADULT";
|
|
8
|
+
MetTargetCondition["WHEELCHAIR"] = "WHEELCHAIR";
|
|
9
|
+
})(MetTargetCondition || (exports.MetTargetCondition = MetTargetCondition = {}));
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IDefault } from "../IDefault";
|
|
2
|
+
import { IMetActivity } from "./IMetActivity";
|
|
3
|
+
export interface IMetActivityPatient extends IDefault {
|
|
4
|
+
patient: string;
|
|
5
|
+
met: IMetActivity;
|
|
6
|
+
sundayTime: string;
|
|
7
|
+
sundayTimeCoefficient: number;
|
|
8
|
+
mondayTime: string;
|
|
9
|
+
mondayTimeCoefficient: number;
|
|
10
|
+
tuesdayTime: string;
|
|
11
|
+
tuesdayTimeCoefficient: number;
|
|
12
|
+
wednesdayTime: string;
|
|
13
|
+
wednesdayTimeCoefficient: number;
|
|
14
|
+
thursdayTime: string;
|
|
15
|
+
thursdayTimeCoefficient: number;
|
|
16
|
+
fridayTime: string;
|
|
17
|
+
fridayTimeCoefficient: number;
|
|
18
|
+
saturdayTime: string;
|
|
19
|
+
saturdayTimeCoefficient: number;
|
|
20
|
+
}
|
package/dist/models/qpc/QPC.d.ts
CHANGED
|
@@ -26,10 +26,10 @@ export declare const QPCSchema: Schema<any, import("mongoose").Model<any, any, a
|
|
|
26
26
|
bornDate: NativeDate;
|
|
27
27
|
status: string;
|
|
28
28
|
photo?: ({} & {
|
|
29
|
-
contentType: string;
|
|
30
29
|
description: string;
|
|
31
|
-
|
|
30
|
+
contentType: string;
|
|
32
31
|
url?: string | null | undefined;
|
|
32
|
+
format?: string | null | undefined;
|
|
33
33
|
}) | null | undefined;
|
|
34
34
|
answeredDateTime?: NativeDate | null | undefined;
|
|
35
35
|
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{} & {
|
|
@@ -39,10 +39,10 @@ export declare const QPCSchema: Schema<any, import("mongoose").Model<any, any, a
|
|
|
39
39
|
bornDate: NativeDate;
|
|
40
40
|
status: string;
|
|
41
41
|
photo?: ({} & {
|
|
42
|
-
contentType: string;
|
|
43
42
|
description: string;
|
|
44
|
-
|
|
43
|
+
contentType: string;
|
|
45
44
|
url?: string | null | undefined;
|
|
45
|
+
format?: string | null | undefined;
|
|
46
46
|
}) | null | undefined;
|
|
47
47
|
answeredDateTime?: NativeDate | null | undefined;
|
|
48
48
|
}>, {}> & import("mongoose").FlatRecord<{} & {
|
|
@@ -52,10 +52,10 @@ export declare const QPCSchema: Schema<any, import("mongoose").Model<any, any, a
|
|
|
52
52
|
bornDate: NativeDate;
|
|
53
53
|
status: string;
|
|
54
54
|
photo?: ({} & {
|
|
55
|
-
contentType: string;
|
|
56
55
|
description: string;
|
|
57
|
-
|
|
56
|
+
contentType: string;
|
|
58
57
|
url?: string | null | undefined;
|
|
58
|
+
format?: string | null | undefined;
|
|
59
59
|
}) | null | undefined;
|
|
60
60
|
answeredDateTime?: NativeDate | null | undefined;
|
|
61
61
|
}> & {
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import { Schema, Types } from "mongoose";
|
|
2
|
-
import {
|
|
3
|
-
import { IDefault } from "../IDefault";
|
|
2
|
+
import { IAnswer } from "../IAnswer";
|
|
4
3
|
import { IQPC } from "./QPC";
|
|
5
|
-
export interface IQPCAnswer extends
|
|
4
|
+
export interface IQPCAnswer extends IAnswer {
|
|
6
5
|
qpc: Types.ObjectId | IQPC;
|
|
7
|
-
reference: Types.ObjectId | IFormUnit;
|
|
8
|
-
answer: any;
|
|
9
|
-
messages: IValidationQuestion[];
|
|
10
|
-
requestGraphicData: IRequestGraphicData[];
|
|
11
6
|
}
|
|
12
7
|
export declare const QPCAnswerSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
13
8
|
timestamps: {
|
|
@@ -17,113 +12,104 @@ export declare const QPCAnswerSchema: Schema<any, import("mongoose").Model<any,
|
|
|
17
12
|
}, {} & {
|
|
18
13
|
account: any;
|
|
19
14
|
reference: any;
|
|
15
|
+
validations: Types.DocumentArray<{
|
|
16
|
+
type: string;
|
|
17
|
+
typeOutput: string;
|
|
18
|
+
formulaToMessage: string;
|
|
19
|
+
}, Types.Subdocument<Types.ObjectId, any, {
|
|
20
|
+
type: string;
|
|
21
|
+
typeOutput: string;
|
|
22
|
+
formulaToMessage: string;
|
|
23
|
+
}> & {
|
|
24
|
+
type: string;
|
|
25
|
+
typeOutput: string;
|
|
26
|
+
formulaToMessage: string;
|
|
27
|
+
}>;
|
|
20
28
|
requestGraphicData: Types.DocumentArray<{
|
|
21
|
-
url: string;
|
|
22
29
|
method: string;
|
|
30
|
+
url: string;
|
|
23
31
|
body?: any;
|
|
24
32
|
dataset?: any;
|
|
25
33
|
}, Types.Subdocument<Types.ObjectId, any, {
|
|
26
|
-
url: string;
|
|
27
34
|
method: string;
|
|
35
|
+
url: string;
|
|
28
36
|
body?: any;
|
|
29
37
|
dataset?: any;
|
|
30
38
|
}> & {
|
|
31
|
-
url: string;
|
|
32
39
|
method: string;
|
|
40
|
+
url: string;
|
|
33
41
|
body?: any;
|
|
34
42
|
dataset?: any;
|
|
35
43
|
}>;
|
|
36
44
|
qpc: any;
|
|
37
|
-
messages: Types.DocumentArray<{
|
|
38
|
-
type?: string | null | undefined;
|
|
39
|
-
content?: string | null | undefined;
|
|
40
|
-
formula?: string | null | undefined;
|
|
41
|
-
typeContent?: string | null | undefined;
|
|
42
|
-
}, Types.Subdocument<Types.ObjectId, any, {
|
|
43
|
-
type?: string | null | undefined;
|
|
44
|
-
content?: string | null | undefined;
|
|
45
|
-
formula?: string | null | undefined;
|
|
46
|
-
typeContent?: string | null | undefined;
|
|
47
|
-
}> & {
|
|
48
|
-
type?: string | null | undefined;
|
|
49
|
-
content?: string | null | undefined;
|
|
50
|
-
formula?: string | null | undefined;
|
|
51
|
-
typeContent?: string | null | undefined;
|
|
52
|
-
}>;
|
|
53
45
|
answer?: any;
|
|
54
46
|
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{} & {
|
|
55
47
|
account: any;
|
|
56
48
|
reference: any;
|
|
49
|
+
validations: Types.DocumentArray<{
|
|
50
|
+
type: string;
|
|
51
|
+
typeOutput: string;
|
|
52
|
+
formulaToMessage: string;
|
|
53
|
+
}, Types.Subdocument<Types.ObjectId, any, {
|
|
54
|
+
type: string;
|
|
55
|
+
typeOutput: string;
|
|
56
|
+
formulaToMessage: string;
|
|
57
|
+
}> & {
|
|
58
|
+
type: string;
|
|
59
|
+
typeOutput: string;
|
|
60
|
+
formulaToMessage: string;
|
|
61
|
+
}>;
|
|
57
62
|
requestGraphicData: Types.DocumentArray<{
|
|
58
|
-
url: string;
|
|
59
63
|
method: string;
|
|
64
|
+
url: string;
|
|
60
65
|
body?: any;
|
|
61
66
|
dataset?: any;
|
|
62
67
|
}, Types.Subdocument<Types.ObjectId, any, {
|
|
63
|
-
url: string;
|
|
64
68
|
method: string;
|
|
69
|
+
url: string;
|
|
65
70
|
body?: any;
|
|
66
71
|
dataset?: any;
|
|
67
72
|
}> & {
|
|
68
|
-
url: string;
|
|
69
73
|
method: string;
|
|
74
|
+
url: string;
|
|
70
75
|
body?: any;
|
|
71
76
|
dataset?: any;
|
|
72
77
|
}>;
|
|
73
78
|
qpc: any;
|
|
74
|
-
messages: Types.DocumentArray<{
|
|
75
|
-
type?: string | null | undefined;
|
|
76
|
-
content?: string | null | undefined;
|
|
77
|
-
formula?: string | null | undefined;
|
|
78
|
-
typeContent?: string | null | undefined;
|
|
79
|
-
}, Types.Subdocument<Types.ObjectId, any, {
|
|
80
|
-
type?: string | null | undefined;
|
|
81
|
-
content?: string | null | undefined;
|
|
82
|
-
formula?: string | null | undefined;
|
|
83
|
-
typeContent?: string | null | undefined;
|
|
84
|
-
}> & {
|
|
85
|
-
type?: string | null | undefined;
|
|
86
|
-
content?: string | null | undefined;
|
|
87
|
-
formula?: string | null | undefined;
|
|
88
|
-
typeContent?: string | null | undefined;
|
|
89
|
-
}>;
|
|
90
79
|
answer?: any;
|
|
91
80
|
}>, {}> & import("mongoose").FlatRecord<{} & {
|
|
92
81
|
account: any;
|
|
93
82
|
reference: any;
|
|
83
|
+
validations: Types.DocumentArray<{
|
|
84
|
+
type: string;
|
|
85
|
+
typeOutput: string;
|
|
86
|
+
formulaToMessage: string;
|
|
87
|
+
}, Types.Subdocument<Types.ObjectId, any, {
|
|
88
|
+
type: string;
|
|
89
|
+
typeOutput: string;
|
|
90
|
+
formulaToMessage: string;
|
|
91
|
+
}> & {
|
|
92
|
+
type: string;
|
|
93
|
+
typeOutput: string;
|
|
94
|
+
formulaToMessage: string;
|
|
95
|
+
}>;
|
|
94
96
|
requestGraphicData: Types.DocumentArray<{
|
|
95
|
-
url: string;
|
|
96
97
|
method: string;
|
|
98
|
+
url: string;
|
|
97
99
|
body?: any;
|
|
98
100
|
dataset?: any;
|
|
99
101
|
}, Types.Subdocument<Types.ObjectId, any, {
|
|
100
|
-
url: string;
|
|
101
102
|
method: string;
|
|
103
|
+
url: string;
|
|
102
104
|
body?: any;
|
|
103
105
|
dataset?: any;
|
|
104
106
|
}> & {
|
|
105
|
-
url: string;
|
|
106
107
|
method: string;
|
|
108
|
+
url: string;
|
|
107
109
|
body?: any;
|
|
108
110
|
dataset?: any;
|
|
109
111
|
}>;
|
|
110
112
|
qpc: any;
|
|
111
|
-
messages: Types.DocumentArray<{
|
|
112
|
-
type?: string | null | undefined;
|
|
113
|
-
content?: string | null | undefined;
|
|
114
|
-
formula?: string | null | undefined;
|
|
115
|
-
typeContent?: string | null | undefined;
|
|
116
|
-
}, Types.Subdocument<Types.ObjectId, any, {
|
|
117
|
-
type?: string | null | undefined;
|
|
118
|
-
content?: string | null | undefined;
|
|
119
|
-
formula?: string | null | undefined;
|
|
120
|
-
typeContent?: string | null | undefined;
|
|
121
|
-
}> & {
|
|
122
|
-
type?: string | null | undefined;
|
|
123
|
-
content?: string | null | undefined;
|
|
124
|
-
formula?: string | null | undefined;
|
|
125
|
-
typeContent?: string | null | undefined;
|
|
126
|
-
}>;
|
|
127
113
|
answer?: any;
|
|
128
114
|
}> & {
|
|
129
115
|
_id: Types.ObjectId;
|
|
@@ -8,16 +8,7 @@ exports.QPCAnswerSchema = new mongoose_1.Schema({
|
|
|
8
8
|
qpc: { type: mongoose_1.Types.ObjectId, ref: "qpc", required: true },
|
|
9
9
|
reference: { type: mongoose_1.Types.ObjectId, ref: "form-unit", required: true },
|
|
10
10
|
answer: { type: mongoose_1.Schema.Types.Mixed },
|
|
11
|
-
|
|
12
|
-
type: [
|
|
13
|
-
{
|
|
14
|
-
type: { type: String, enum: FormUnit_1.TypeValidationEnum },
|
|
15
|
-
formula: { type: String },
|
|
16
|
-
typeContent: { type: String, enum: FormUnit_1.TypeOutputValidationEnum },
|
|
17
|
-
content: { type: String }
|
|
18
|
-
}
|
|
19
|
-
]
|
|
20
|
-
},
|
|
11
|
+
validations: { type: [FormUnit_1.ValidationSchema] },
|
|
21
12
|
requestGraphicData: { type: [FormUnit_1.RequestGraphicDataSchema] }
|
|
22
13
|
}, {
|
|
23
14
|
timestamps: { createdAt: "createdAtDateTime", updatedAt: "updatedAtDateTime" }
|
package/package.json
CHANGED