This commit is contained in:
wayanrivan
2026-05-05 10:55:12 +07:00
parent eb8598bfb5
commit b3be4f8437
2 changed files with 429 additions and 110 deletions

View File

@ -153,7 +153,7 @@ export class FosterCareHistoryController {
content: { content: {
"application/json": { "application/json": {
schema: { schema: {
$ref: "#/components/schemas/diagnosis" $ref: "#/components/schemas/fostercarehistory"
} }
} }
} }
@ -166,6 +166,71 @@ export class FosterCareHistoryController {
diagnosis: Joi.string().max(256).required().label("Diagnosis"), diagnosis: Joi.string().max(256).required().label("Diagnosis"),
code: Joi.string().max(128).required().label("Code"), code: Joi.string().max(128).required().label("Code"),
status: Joi.string().required().label("Status"), status: Joi.string().required().label("Status"),
category: Joi.string().max(128).allow(null, "").label("Category"),
subcategory: Joi.string().max(128).allow(null, "").label("Subcategory"),
definition: Joi.string().max(128).allow(null, "").label("Definition"),
objective: Joi.string().max(128).allow(null, "").label("Objective"),
result_criteria: Joi.array().items(
Joi.object({
group: Joi.number().allow(null),
name: Joi.string().allow(null, ""),
})
).allow(null).label("Result Criteria"),
causes: Joi.array().items(
Joi.object({
group: Joi.string().allow(null, ""),
name: Joi.string().allow(null, ""),
})
).allow(null).label("Causes"),
related_clinical_condition: Joi.array().items(
Joi.object({
name: Joi.string().allow(null, ""),
})
).allow(null).label("Related Clinical Condition"),
subjective_major: Joi.array().items(
Joi.object({
group: Joi.string().allow(null, ""),
name: Joi.string().allow(null, ""),
})
).allow(null).label("Subjective Major"),
objectitve_major: Joi.array().items(
Joi.object({
group: Joi.string().allow(null, ""),
name: Joi.string().allow(null, ""),
})
).allow(null).label("Objective Major"),
subjective_minor: Joi.array().items(
Joi.object({
group: Joi.string().allow(null, ""),
name: Joi.string().allow(null, ""),
})
).allow(null).label("Subjective Minor"),
objective_minor: Joi.array().items(
Joi.object({
group: Joi.string().allow(null, ""),
name: Joi.string().allow(null, ""),
})
).allow(null).label("Objective Minor"),
observation: Joi.array().items(
Joi.object({
name: Joi.string().allow(null, ""),
})
).allow(null).label("Observation"),
therapeutic: Joi.array().items(
Joi.object({
name: Joi.string().allow(null, ""),
})
).allow(null).label("Therapeutic"),
education: Joi.array().items(
Joi.object({
name: Joi.string().allow(null, ""),
})
).allow(null).label("Education"),
colaboration: Joi.array().items(
Joi.object({
name: Joi.string().allow(null, ""),
})
).allow(null).label("Colaboration"),
}); });
let param: any = await schema.validateAsync(req.body); let param: any = await schema.validateAsync(req.body);
@ -180,6 +245,21 @@ export class FosterCareHistoryController {
fostercarehistory.diagnosis = param.diagnosis; fostercarehistory.diagnosis = param.diagnosis;
fostercarehistory.code = param.code; fostercarehistory.code = param.code;
fostercarehistory.status = param.status; fostercarehistory.status = param.status;
fostercarehistory.category = param.category;
fostercarehistory.subcategory = param.subcategory;
fostercarehistory.definition = param.definition;
fostercarehistory.objective = param.objective;
fostercarehistory.result_criteria = param.result_criteria ?? [];
fostercarehistory.causes = param.causes ?? [];
fostercarehistory.related_clinical_condition = param.related_clinical_condition ?? [];
fostercarehistory.subjective_major = param.subjective_major ?? [];
fostercarehistory.objectitve_major = param.objectitve_major ?? [];
fostercarehistory.subjective_minor = param.subjective_minor ?? [];
fostercarehistory.objective_minor = param.objective_minor ?? [];
fostercarehistory.observation = param.observation ?? [];
fostercarehistory.therapeutic = param.therapeutic ?? [];
fostercarehistory.education = param.education ?? [];
fostercarehistory.colaboration = param.colaboration ?? [];
fostercarehistory.created_by = req.auth?.data.name; fostercarehistory.created_by = req.auth?.data.name;
fostercarehistory.updated_by = req.auth?.data.name; fostercarehistory.updated_by = req.auth?.data.name;
await queryRunner.manager.save(fostercarehistory); await queryRunner.manager.save(fostercarehistory);
@ -248,7 +328,7 @@ export class FosterCareHistoryController {
content: { content: {
"application/json": { "application/json": {
schema: { schema: {
$ref: "#/components/schemas/diagnosis" $ref: "#/components/schemas/fostercarehistory"
} }
} }
} }
@ -266,6 +346,71 @@ export class FosterCareHistoryController {
diagnosis: Joi.string().max(256).required().label("Diagnosis"), diagnosis: Joi.string().max(256).required().label("Diagnosis"),
code: Joi.string().max(128).required().label("Code"), code: Joi.string().max(128).required().label("Code"),
status: Joi.string().required().label("Status"), status: Joi.string().required().label("Status"),
category: Joi.string().max(128).allow(null, "").label("Category"),
subcategory: Joi.string().max(128).allow(null, "").label("Subcategory"),
definition: Joi.string().max(128).allow(null, "").label("Definition"),
objective: Joi.string().max(128).allow(null, "").label("Objective"),
result_criteria: Joi.array().items(
Joi.object({
group: Joi.number().allow(null),
name: Joi.string().allow(null, ""),
})
).allow(null).label("Result Criteria"),
causes: Joi.array().items(
Joi.object({
group: Joi.string().allow(null, ""),
name: Joi.string().allow(null, ""),
})
).allow(null).label("Causes"),
related_clinical_condition: Joi.array().items(
Joi.object({
name: Joi.string().allow(null, ""),
})
).allow(null).label("Related Clinical Condition"),
subjective_major: Joi.array().items(
Joi.object({
group: Joi.string().allow(null, ""),
name: Joi.string().allow(null, ""),
})
).allow(null).label("Subjective Major"),
objectitve_major: Joi.array().items(
Joi.object({
group: Joi.string().allow(null, ""),
name: Joi.string().allow(null, ""),
})
).allow(null).label("Objective Major"),
subjective_minor: Joi.array().items(
Joi.object({
group: Joi.string().allow(null, ""),
name: Joi.string().allow(null, ""),
})
).allow(null).label("Subjective Minor"),
objective_minor: Joi.array().items(
Joi.object({
group: Joi.string().allow(null, ""),
name: Joi.string().allow(null, ""),
})
).allow(null).label("Objective Minor"),
observation: Joi.array().items(
Joi.object({
name: Joi.string().allow(null, ""),
})
).allow(null).label("Observation"),
therapeutic: Joi.array().items(
Joi.object({
name: Joi.string().allow(null, ""),
})
).allow(null).label("Therapeutic"),
education: Joi.array().items(
Joi.object({
name: Joi.string().allow(null, ""),
})
).allow(null).label("Education"),
colaboration: Joi.array().items(
Joi.object({
name: Joi.string().allow(null, ""),
})
).allow(null).label("Colaboration"),
}); });
let param: any = await schema.validateAsync(req.body); let param: any = await schema.validateAsync(req.body);
@ -285,6 +430,21 @@ export class FosterCareHistoryController {
fostercarehistory.diagnosis = param.diagnosis; fostercarehistory.diagnosis = param.diagnosis;
fostercarehistory.code = param.code; fostercarehistory.code = param.code;
fostercarehistory.status = param.status; fostercarehistory.status = param.status;
fostercarehistory.category = param.category;
fostercarehistory.subcategory = param.subcategory;
fostercarehistory.definition = param.definition;
fostercarehistory.objective = param.objective;
fostercarehistory.result_criteria = param.result_criteria ?? fostercarehistory.result_criteria;
fostercarehistory.causes = param.causes ?? fostercarehistory.causes;
fostercarehistory.related_clinical_condition = param.related_clinical_condition ?? fostercarehistory.related_clinical_condition;
fostercarehistory.subjective_major = param.subjective_major ?? fostercarehistory.subjective_major;
fostercarehistory.objectitve_major = param.objectitve_major ?? fostercarehistory.objectitve_major;
fostercarehistory.subjective_minor = param.subjective_minor ?? fostercarehistory.subjective_minor;
fostercarehistory.objective_minor = param.objective_minor ?? fostercarehistory.objective_minor;
fostercarehistory.observation = param.observation ?? fostercarehistory.observation;
fostercarehistory.therapeutic = param.therapeutic ?? fostercarehistory.therapeutic;
fostercarehistory.education = param.education ?? fostercarehistory.education;
fostercarehistory.colaboration = param.colaboration ?? fostercarehistory.colaboration;
fostercarehistory.updated_by = req.auth?.data.name; fostercarehistory.updated_by = req.auth?.data.name;
await queryRunner.manager.save(fostercarehistory); await queryRunner.manager.save(fostercarehistory);

View File

@ -509,6 +509,165 @@ const doc = {
$bodytext: "string", $bodytext: "string",
$type: "responsible-party-consent | patient-education | inpatient-admission-consent | provision-of-information | ward-class-upgrade-entitlement", $type: "responsible-party-consent | patient-education | inpatient-admission-consent | provision-of-information | ward-class-upgrade-entitlement",
}, },
fostercarehistory: {
type: "object",
properties: {
diagnosis: {
type: "string",
maxLength: 256,
example: "Gangguan Pertukaran Gas"
},
code: {
type: "string",
maxLength: 128,
example: "D.0003"
},
status: {
type: "string",
example: "active"
},
category: {
type: "string",
maxLength: 128,
nullable: true,
example: "Fisiologis"
},
subcategory: {
type: "string",
maxLength: 128,
nullable: true,
example: "Respirasi"
},
definition: {
type: "string",
maxLength: 128,
nullable: true,
example: "Kelebihan atau kekurangan oksigenasi"
},
objective: {
type: "string",
maxLength: 128,
nullable: true,
example: "Meningkatkan pertukaran gas"
},
result_criteria: {
type: "array",
nullable: true,
items: {
type: "object",
properties: {
group: { type: "number", example: 1 },
name: { type: "string", example: "Saturasi oksigen membaik" }
}
}
},
causes: {
type: "array",
nullable: true,
items: {
type: "object",
properties: {
group: { type: "string", example: "Fisiologis" },
name: { type: "string", example: "Ketidakseimbangan ventilasi-perfusi" }
}
}
},
related_clinical_condition: {
type: "array",
nullable: true,
items: {
type: "object",
properties: {
name: { type: "string", example: "Penyakit Paru Obstruktif Kronis (PPOK)" }
}
}
},
subjective_major: {
type: "array",
nullable: true,
items: {
type: "object",
properties: {
group: { type: "string", example: "Mayor" },
name: { type: "string", example: "Dispnea" }
}
}
},
objectitve_major: {
type: "array",
nullable: true,
items: {
type: "object",
properties: {
group: { type: "string", example: "Mayor" },
name: { type: "string", example: "PCO2 meningkat/menurun" }
}
}
},
subjective_minor: {
type: "array",
nullable: true,
items: {
type: "object",
properties: {
group: { type: "string", example: "Minor" },
name: { type: "string", example: "Pusing" }
}
}
},
objective_minor: {
type: "array",
nullable: true,
items: {
type: "object",
properties: {
group: { type: "string", example: "Minor" },
name: { type: "string", example: "Napas cuping hidung" }
}
}
},
observation: {
type: "array",
nullable: true,
items: {
type: "object",
properties: {
name: { type: "string", example: "Monitor frekuensi, irama, kedalaman napas" }
}
}
},
therapeutic: {
type: "array",
nullable: true,
items: {
type: "object",
properties: {
name: { type: "string", example: "Berikan posisi semi-Fowler" }
}
}
},
education: {
type: "array",
nullable: true,
items: {
type: "object",
properties: {
name: { type: "string", example: "Anjurkan teknik batuk efektif" }
}
}
},
colaboration: {
type: "array",
nullable: true,
items: {
type: "object",
properties: {
name: { type: "string", example: "Kolaborasi pemberian bronkodilator" }
}
}
},
}
},
}, },
parameters: {}, parameters: {},
securitySchemes: { securitySchemes: {