tychat-contracts 1.3.5 → 1.3.6

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.
@@ -1,3 +1,4 @@
1
+ import { AnamnesisCustomFieldDto } from '../configurations';
1
2
  export declare class AnamnesisTokenSessionPatientDto {
2
3
  id: string;
3
4
  name: string;
@@ -11,5 +12,6 @@ export declare class AnamnesisTokenSessionDto {
11
12
  expiresAt?: string;
12
13
  appointmentId?: string;
13
14
  patient?: AnamnesisTokenSessionPatientDto;
15
+ anamnesisCustomFields?: AnamnesisCustomFieldDto[];
14
16
  }
15
17
  //# sourceMappingURL=anamnesis-token-session.dto.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"anamnesis-token-session.dto.d.ts","sourceRoot":"","sources":["../../src/anamneses/anamnesis-token-session.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,+BAA+B;IAE1C,EAAE,EAAE,MAAM,CAAC;IAGX,IAAI,EAAE,MAAM,CAAC;IAGb,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAGnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,qBAAa,wBAAwB;IAEnC,KAAK,EAAE,OAAO,CAAC;IAMf,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,GAAG,UAAU,GAAG,eAAe,CAAC;IAGhE,KAAK,CAAC,EAAE,MAAM,CAAC;IAGf,SAAS,CAAC,EAAE,MAAM,CAAC;IAGnB,aAAa,CAAC,EAAE,MAAM,CAAC;IAGvB,OAAO,CAAC,EAAE,+BAA+B,CAAC;CAC3C"}
1
+ {"version":3,"file":"anamnesis-token-session.dto.d.ts","sourceRoot":"","sources":["../../src/anamneses/anamnesis-token-session.dto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,qBAAa,+BAA+B;IAE1C,EAAE,EAAE,MAAM,CAAC;IAGX,IAAI,EAAE,MAAM,CAAC;IAGb,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAGnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,qBAAa,wBAAwB;IAEnC,KAAK,EAAE,OAAO,CAAC;IAMf,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,GAAG,UAAU,GAAG,eAAe,CAAC;IAGhE,KAAK,CAAC,EAAE,MAAM,CAAC;IAGf,SAAS,CAAC,EAAE,MAAM,CAAC;IAGnB,aAAa,CAAC,EAAE,MAAM,CAAC;IAGvB,OAAO,CAAC,EAAE,+BAA+B,CAAC;IAM1C,qBAAqB,CAAC,EAAE,uBAAuB,EAAE,CAAC;CACnD"}
@@ -11,6 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.AnamnesisTokenSessionDto = exports.AnamnesisTokenSessionPatientDto = void 0;
13
13
  const swagger_1 = require("@nestjs/swagger");
14
+ const configurations_1 = require("../configurations");
14
15
  class AnamnesisTokenSessionPatientDto {
15
16
  id;
16
17
  name;
@@ -41,6 +42,7 @@ class AnamnesisTokenSessionDto {
41
42
  expiresAt;
42
43
  appointmentId;
43
44
  patient;
45
+ anamnesisCustomFields;
44
46
  }
45
47
  exports.AnamnesisTokenSessionDto = AnamnesisTokenSessionDto;
46
48
  __decorate([
@@ -70,3 +72,10 @@ __decorate([
70
72
  (0, swagger_1.ApiPropertyOptional)({ type: AnamnesisTokenSessionPatientDto }),
71
73
  __metadata("design:type", AnamnesisTokenSessionPatientDto)
72
74
  ], AnamnesisTokenSessionDto.prototype, "patient", void 0);
75
+ __decorate([
76
+ (0, swagger_1.ApiPropertyOptional)({
77
+ type: [configurations_1.AnamnesisCustomFieldDto],
78
+ description: 'Campos adicionais da anamnese configurados pela clínica',
79
+ }),
80
+ __metadata("design:type", Array)
81
+ ], AnamnesisTokenSessionDto.prototype, "anamnesisCustomFields", void 0);
@@ -0,0 +1,8 @@
1
+ export declare const ANAMNESIS_CUSTOM_FIELD_TYPES: readonly ["number", "date", "boolean", "text"];
2
+ export type AnamnesisCustomFieldType = (typeof ANAMNESIS_CUSTOM_FIELD_TYPES)[number];
3
+ export declare class AnamnesisCustomFieldDto {
4
+ enabled: boolean;
5
+ question: string;
6
+ type: AnamnesisCustomFieldType;
7
+ }
8
+ //# sourceMappingURL=anamnesis-custom-field.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anamnesis-custom-field.dto.d.ts","sourceRoot":"","sources":["../../src/configurations/anamnesis-custom-field.dto.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,4BAA4B,gDAAiD,CAAC;AAC3F,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,4BAA4B,CAAC,CAAC,MAAM,CAAC,CAAC;AAErF,qBAAa,uBAAuB;IAMlC,OAAO,EAAE,OAAO,CAAC;IAQjB,QAAQ,EAAE,MAAM,CAAC;IAQjB,IAAI,EAAE,wBAAwB,CAAC;CAChC"}
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.AnamnesisCustomFieldDto = exports.ANAMNESIS_CUSTOM_FIELD_TYPES = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ const class_validator_1 = require("class-validator");
15
+ exports.ANAMNESIS_CUSTOM_FIELD_TYPES = ['number', 'date', 'boolean', 'text'];
16
+ class AnamnesisCustomFieldDto {
17
+ enabled;
18
+ question;
19
+ type;
20
+ }
21
+ exports.AnamnesisCustomFieldDto = AnamnesisCustomFieldDto;
22
+ __decorate([
23
+ (0, swagger_1.ApiProperty)({
24
+ description: 'Campo está ativo para aparecer no formulário público',
25
+ example: true,
26
+ }),
27
+ (0, class_validator_1.IsBoolean)(),
28
+ __metadata("design:type", Boolean)
29
+ ], AnamnesisCustomFieldDto.prototype, "enabled", void 0);
30
+ __decorate([
31
+ (0, swagger_1.ApiProperty)({
32
+ description: 'Pergunta exibida ao paciente',
33
+ example: 'Qual sua pressão arterial média?',
34
+ }),
35
+ (0, class_validator_1.IsString)(),
36
+ (0, class_validator_1.MinLength)(3),
37
+ __metadata("design:type", String)
38
+ ], AnamnesisCustomFieldDto.prototype, "question", void 0);
39
+ __decorate([
40
+ (0, swagger_1.ApiProperty)({
41
+ description: 'Tipo de resposta esperada para o campo',
42
+ enum: exports.ANAMNESIS_CUSTOM_FIELD_TYPES,
43
+ example: 'number',
44
+ }),
45
+ (0, class_validator_1.IsIn)(exports.ANAMNESIS_CUSTOM_FIELD_TYPES),
46
+ __metadata("design:type", String)
47
+ ], AnamnesisCustomFieldDto.prototype, "type", void 0);
@@ -1,10 +1,12 @@
1
1
  import { OpeningHoursSlotDto } from './opening-hours-slot.dto';
2
+ import { AnamnesisCustomFieldDto } from './anamnesis-custom-field.dto';
2
3
  /**
3
4
  * Response DTO for clinic configuration (opening hours, etc.).
4
5
  */
5
6
  export declare class ClinicConfigurationDto {
6
7
  id: string;
7
8
  opening_hours: OpeningHoursSlotDto[];
9
+ anamnesis_custom_fields?: AnamnesisCustomFieldDto[];
8
10
  createdAt: Date;
9
11
  updatedAt: Date;
10
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"clinic-configuration.dto.d.ts","sourceRoot":"","sources":["../../src/configurations/clinic-configuration.dto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D;;GAEG;AACH,qBAAa,sBAAsB;IAKjC,EAAE,EAAE,MAAM,CAAC;IAMX,aAAa,EAAE,mBAAmB,EAAE,CAAC;IAMrC,SAAS,EAAE,IAAI,CAAC;IAMhB,SAAS,EAAE,IAAI,CAAC;CACjB"}
1
+ {"version":3,"file":"clinic-configuration.dto.d.ts","sourceRoot":"","sources":["../../src/configurations/clinic-configuration.dto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAEvE;;GAEG;AACH,qBAAa,sBAAsB;IAKjC,EAAE,EAAE,MAAM,CAAC;IAMX,aAAa,EAAE,mBAAmB,EAAE,CAAC;IAOrC,uBAAuB,CAAC,EAAE,uBAAuB,EAAE,CAAC;IAMpD,SAAS,EAAE,IAAI,CAAC;IAMhB,SAAS,EAAE,IAAI,CAAC;CACjB"}
@@ -12,12 +12,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.ClinicConfigurationDto = void 0;
13
13
  const swagger_1 = require("@nestjs/swagger");
14
14
  const opening_hours_slot_dto_1 = require("./opening-hours-slot.dto");
15
+ const anamnesis_custom_field_dto_1 = require("./anamnesis-custom-field.dto");
15
16
  /**
16
17
  * Response DTO for clinic configuration (opening hours, etc.).
17
18
  */
18
19
  class ClinicConfigurationDto {
19
20
  id;
20
21
  opening_hours;
22
+ anamnesis_custom_fields;
21
23
  createdAt;
22
24
  updatedAt;
23
25
  }
@@ -36,6 +38,14 @@ __decorate([
36
38
  }),
37
39
  __metadata("design:type", Array)
38
40
  ], ClinicConfigurationDto.prototype, "opening_hours", void 0);
41
+ __decorate([
42
+ (0, swagger_1.ApiProperty)({
43
+ description: 'Campos adicionais de anamnese configurados pela clínica',
44
+ type: [anamnesis_custom_field_dto_1.AnamnesisCustomFieldDto],
45
+ required: false,
46
+ }),
47
+ __metadata("design:type", Array)
48
+ ], ClinicConfigurationDto.prototype, "anamnesis_custom_fields", void 0);
39
49
  __decorate([
40
50
  (0, swagger_1.ApiProperty)({
41
51
  description: 'Creation timestamp',
@@ -1,4 +1,5 @@
1
1
  export * from './opening-hours-slot.dto';
2
+ export * from './anamnesis-custom-field.dto';
2
3
  export * from './update-clinic-configuration.dto';
3
4
  export * from './clinic-configuration.dto';
4
5
  export * from './ai-tool-policy.enums';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/configurations/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,mCAAmC,CAAC;AAClD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oCAAoC,CAAC;AACnD,cAAc,wCAAwC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/configurations/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mCAAmC,CAAC;AAClD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oCAAoC,CAAC;AACnD,cAAc,wCAAwC,CAAC"}
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./opening-hours-slot.dto"), exports);
18
+ __exportStar(require("./anamnesis-custom-field.dto"), exports);
18
19
  __exportStar(require("./update-clinic-configuration.dto"), exports);
19
20
  __exportStar(require("./clinic-configuration.dto"), exports);
20
21
  __exportStar(require("./ai-tool-policy.enums"), exports);
@@ -1,5 +1,7 @@
1
1
  import { OpeningHoursSlotDto } from './opening-hours-slot.dto';
2
+ import { AnamnesisCustomFieldDto } from './anamnesis-custom-field.dto';
2
3
  export declare class UpdateClinicConfigurationDto {
3
4
  opening_hours: OpeningHoursSlotDto[];
5
+ anamnesis_custom_fields?: AnamnesisCustomFieldDto[];
4
6
  }
5
7
  //# sourceMappingURL=update-clinic-configuration.dto.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"update-clinic-configuration.dto.d.ts","sourceRoot":"","sources":["../../src/configurations/update-clinic-configuration.dto.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,qBAAa,4BAA4B;IAYvC,aAAa,EAAE,mBAAmB,EAAE,CAAC;CACtC"}
1
+ {"version":3,"file":"update-clinic-configuration.dto.d.ts","sourceRoot":"","sources":["../../src/configurations/update-clinic-configuration.dto.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAEvE,qBAAa,4BAA4B;IAYvC,aAAa,EAAE,mBAAmB,EAAE,CAAC;IAerC,uBAAuB,CAAC,EAAE,uBAAuB,EAAE,CAAC;CACrD"}
@@ -14,8 +14,10 @@ const swagger_1 = require("@nestjs/swagger");
14
14
  const class_transformer_1 = require("class-transformer");
15
15
  const class_validator_1 = require("class-validator");
16
16
  const opening_hours_slot_dto_1 = require("./opening-hours-slot.dto");
17
+ const anamnesis_custom_field_dto_1 = require("./anamnesis-custom-field.dto");
17
18
  class UpdateClinicConfigurationDto {
18
19
  opening_hours;
20
+ anamnesis_custom_fields;
19
21
  }
20
22
  exports.UpdateClinicConfigurationDto = UpdateClinicConfigurationDto;
21
23
  __decorate([
@@ -32,3 +34,19 @@ __decorate([
32
34
  (0, class_transformer_1.Type)(() => opening_hours_slot_dto_1.OpeningHoursSlotDto),
33
35
  __metadata("design:type", Array)
34
36
  ], UpdateClinicConfigurationDto.prototype, "opening_hours", void 0);
37
+ __decorate([
38
+ (0, swagger_1.ApiProperty)({
39
+ description: 'Campos adicionais de anamnese configurados pela clínica',
40
+ type: [anamnesis_custom_field_dto_1.AnamnesisCustomFieldDto],
41
+ required: false,
42
+ example: [
43
+ { enabled: true, question: 'Qual foi sua última glicemia?', type: 'number' },
44
+ { enabled: true, question: 'Data do último exame?', type: 'date' },
45
+ ],
46
+ }),
47
+ (0, class_validator_1.IsOptional)(),
48
+ (0, class_validator_1.IsArray)(),
49
+ (0, class_validator_1.ValidateNested)({ each: true }),
50
+ (0, class_transformer_1.Type)(() => anamnesis_custom_field_dto_1.AnamnesisCustomFieldDto),
51
+ __metadata("design:type", Array)
52
+ ], UpdateClinicConfigurationDto.prototype, "anamnesis_custom_fields", void 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tychat-contracts",
3
- "version": "1.3.5",
3
+ "version": "1.3.6",
4
4
  "description": "DTOs compartilhados com class-validator (API e microserviços)",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,4 +1,5 @@
1
1
  import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
2
+ import { AnamnesisCustomFieldDto } from '../configurations';
2
3
 
3
4
  export class AnamnesisTokenSessionPatientDto {
4
5
  @ApiProperty({ example: '550e8400-e29b-41d4-a716-446655440000' })
@@ -35,4 +36,10 @@ export class AnamnesisTokenSessionDto {
35
36
 
36
37
  @ApiPropertyOptional({ type: AnamnesisTokenSessionPatientDto })
37
38
  patient?: AnamnesisTokenSessionPatientDto;
39
+
40
+ @ApiPropertyOptional({
41
+ type: [AnamnesisCustomFieldDto],
42
+ description: 'Campos adicionais da anamnese configurados pela clínica',
43
+ })
44
+ anamnesisCustomFields?: AnamnesisCustomFieldDto[];
38
45
  }
@@ -0,0 +1,30 @@
1
+ import { ApiProperty } from '@nestjs/swagger';
2
+ import { IsBoolean, IsIn, IsString, MinLength } from 'class-validator';
3
+
4
+ export const ANAMNESIS_CUSTOM_FIELD_TYPES = ['number', 'date', 'boolean', 'text'] as const;
5
+ export type AnamnesisCustomFieldType = (typeof ANAMNESIS_CUSTOM_FIELD_TYPES)[number];
6
+
7
+ export class AnamnesisCustomFieldDto {
8
+ @ApiProperty({
9
+ description: 'Campo está ativo para aparecer no formulário público',
10
+ example: true,
11
+ })
12
+ @IsBoolean()
13
+ enabled: boolean;
14
+
15
+ @ApiProperty({
16
+ description: 'Pergunta exibida ao paciente',
17
+ example: 'Qual sua pressão arterial média?',
18
+ })
19
+ @IsString()
20
+ @MinLength(3)
21
+ question: string;
22
+
23
+ @ApiProperty({
24
+ description: 'Tipo de resposta esperada para o campo',
25
+ enum: ANAMNESIS_CUSTOM_FIELD_TYPES,
26
+ example: 'number',
27
+ })
28
+ @IsIn(ANAMNESIS_CUSTOM_FIELD_TYPES)
29
+ type: AnamnesisCustomFieldType;
30
+ }
@@ -1,5 +1,6 @@
1
1
  import { ApiProperty } from '@nestjs/swagger';
2
2
  import { OpeningHoursSlotDto } from './opening-hours-slot.dto';
3
+ import { AnamnesisCustomFieldDto } from './anamnesis-custom-field.dto';
3
4
 
4
5
  /**
5
6
  * Response DTO for clinic configuration (opening hours, etc.).
@@ -17,6 +18,13 @@ export class ClinicConfigurationDto {
17
18
  })
18
19
  opening_hours: OpeningHoursSlotDto[];
19
20
 
21
+ @ApiProperty({
22
+ description: 'Campos adicionais de anamnese configurados pela clínica',
23
+ type: [AnamnesisCustomFieldDto],
24
+ required: false,
25
+ })
26
+ anamnesis_custom_fields?: AnamnesisCustomFieldDto[];
27
+
20
28
  @ApiProperty({
21
29
  description: 'Creation timestamp',
22
30
  example: '2026-03-10T12:00:00.000Z',
@@ -1,4 +1,5 @@
1
1
  export * from './opening-hours-slot.dto';
2
+ export * from './anamnesis-custom-field.dto';
2
3
  export * from './update-clinic-configuration.dto';
3
4
  export * from './clinic-configuration.dto';
4
5
  export * from './ai-tool-policy.enums';
@@ -2,9 +2,11 @@ import { ApiProperty } from '@nestjs/swagger';
2
2
  import { Type } from 'class-transformer';
3
3
  import {
4
4
  IsArray,
5
+ IsOptional,
5
6
  ValidateNested,
6
7
  } from 'class-validator';
7
8
  import { OpeningHoursSlotDto } from './opening-hours-slot.dto';
9
+ import { AnamnesisCustomFieldDto } from './anamnesis-custom-field.dto';
8
10
 
9
11
  export class UpdateClinicConfigurationDto {
10
12
  @ApiProperty({
@@ -19,4 +21,19 @@ export class UpdateClinicConfigurationDto {
19
21
  @ValidateNested({ each: true })
20
22
  @Type(() => OpeningHoursSlotDto)
21
23
  opening_hours: OpeningHoursSlotDto[];
24
+
25
+ @ApiProperty({
26
+ description: 'Campos adicionais de anamnese configurados pela clínica',
27
+ type: [AnamnesisCustomFieldDto],
28
+ required: false,
29
+ example: [
30
+ { enabled: true, question: 'Qual foi sua última glicemia?', type: 'number' },
31
+ { enabled: true, question: 'Data do último exame?', type: 'date' },
32
+ ],
33
+ })
34
+ @IsOptional()
35
+ @IsArray()
36
+ @ValidateNested({ each: true })
37
+ @Type(() => AnamnesisCustomFieldDto)
38
+ anamnesis_custom_fields?: AnamnesisCustomFieldDto[];
22
39
  }