diff --git a/src/controllers/OrganizationController.ts b/src/controllers/OrganizationController.ts index c44120df..038f5314 100644 --- a/src/controllers/OrganizationController.ts +++ b/src/controllers/OrganizationController.ts @@ -7564,7 +7564,21 @@ export class OrganizationController extends Controller { where: { orgRevision: { orgRevisionIsDraft: false, orgRevisionIsCurrent: true }, }, - order: { isDeputy: "DESC", orgRootOrder: "ASC" }, + order: { isDeputy: "DESC", DEPARTMENT_CODE: "ASC", orgRootName: "ASC" }, + select: ["orgRootName"], + }); + const hospital = await this.orgRootRepository.find({ + where: [ + { + orgRevision: { orgRevisionIsDraft: false, orgRevisionIsCurrent: true }, + isDeputy: true, + }, + { + orgRevision: { orgRevisionIsDraft: false, orgRevisionIsCurrent: true }, + orgRootRankSub: "HOSPITAL", + }, + ], + order: { isDeputy: "DESC", DEPARTMENT_CODE: "ASC", orgRootName: "ASC" }, select: ["orgRootName"], }); const posType = await this.posTypeRepository.find({ @@ -7577,6 +7591,7 @@ export class OrganizationController extends Controller { }); return new HttpSuccess({ root: root.map((x) => x.orgRootName), + hospital: hospital.map((x) => x.orgRootName), posTypeNameOrder: posType.map((x) => x.posTypeName), posLevelNameOrder: posLevel.map((x) => x.posLevelName), });