Merge branch 'migration' of https://github.com/dikstub-rssa/simrs-be into feat/chemo-plan
# Conflicts: # internal/domain/main-entities/chemo/dto.go # internal/use-case/main-use-case/encounter/helper.go
This commit is contained in:
@@ -27,6 +27,8 @@ go.work.sum
|
||||
# env file
|
||||
.env
|
||||
config.yml
|
||||
Dockerfile-main-api
|
||||
Dockerfile-sync-api
|
||||
**/atlas.hcl
|
||||
!**/atlas.hcl.example
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
FROM golang:1.24.10 AS builder
|
||||
WORKDIR /src
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
COPY . .
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -o ./cmd/main-api/main-api ./cmd/main-api/main.go
|
||||
|
||||
FROM alpine:latest
|
||||
WORKDIR /app
|
||||
COPY --from=builder /src/assets .
|
||||
COPY --from=builder /src/cmd/main-api/main-api .
|
||||
COPY --from=builder /src/cmd/main-api/config.yml .
|
||||
EXPOSE 8010
|
||||
CMD ["./main-api"]
|
||||
@@ -0,0 +1,14 @@
|
||||
FROM golang:1.24.10 AS builder
|
||||
WORKDIR /src
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
COPY . .
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -o ./cmd/simgos-sync-api/simgos-sync-api ./cmd/simgos-sync-api/main.go
|
||||
|
||||
FROM alpine:latest
|
||||
WORKDIR /app
|
||||
COPY --from=builder /src/assets .
|
||||
COPY --from=builder /src/cmd/simgos-sync-api/simgos-sync-api .
|
||||
COPY --from=builder /src/cmd/simgos-sync-api/config.yml .
|
||||
EXPOSE 8011
|
||||
CMD ["./simgos-sync-api"]
|
||||
@@ -0,0 +1,26 @@
|
||||
-- Create "ProcedureReport" table
|
||||
CREATE TABLE "public"."ProcedureReport" (
|
||||
"Id" bigserial NOT NULL,
|
||||
"CreatedAt" timestamptz NULL,
|
||||
"UpdatedAt" timestamptz NULL,
|
||||
"DeletedAt" timestamptz NULL,
|
||||
"Encounter_Id" bigint NULL,
|
||||
"Date" timestamptz NOT NULL,
|
||||
"Doctor_Code" character varying(10) NULL,
|
||||
"Operator_Name" text NULL,
|
||||
"Assistant_Name" text NULL,
|
||||
"Instrumentor_Name" text NULL,
|
||||
"Diagnose" character varying(1024) NULL,
|
||||
"Nurse_Name" character varying(10) NULL,
|
||||
"Anesthesia_Doctor_Code" character varying(10) NULL,
|
||||
"Anesthesia_Nurse_Name" text NULL,
|
||||
"ProcedureValue" text NULL,
|
||||
"ExecutionValue" text NULL,
|
||||
"Type_Code" text NULL,
|
||||
PRIMARY KEY ("Id"),
|
||||
CONSTRAINT "fk_ProcedureReport_Anesthesia_Doctor" FOREIGN KEY ("Anesthesia_Doctor_Code") REFERENCES "public"."Doctor" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION,
|
||||
CONSTRAINT "fk_ProcedureReport_Doctor" FOREIGN KEY ("Doctor_Code") REFERENCES "public"."Doctor" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION,
|
||||
CONSTRAINT "fk_ProcedureReport_Encounter" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
|
||||
);
|
||||
-- Drop "ActionReport" table
|
||||
DROP TABLE "public"."ActionReport";
|
||||
@@ -0,0 +1,2 @@
|
||||
-- Modify "ProcedureReport" table
|
||||
ALTER TABLE "public"."ProcedureReport" ALTER COLUMN "Nurse_Name" TYPE text;
|
||||
@@ -0,0 +1,12 @@
|
||||
-- Create "Registration" table
|
||||
CREATE TABLE "public"."Registration" (
|
||||
"Id" bigserial NOT NULL,
|
||||
"CreatedAt" timestamptz NULL,
|
||||
"UpdatedAt" timestamptz NULL,
|
||||
"DeletedAt" timestamptz NULL,
|
||||
"Employee_Id" bigint NULL,
|
||||
"Installation_Code" character varying(20) NULL,
|
||||
PRIMARY KEY ("Id"),
|
||||
CONSTRAINT "fk_Registration_Employee" FOREIGN KEY ("Employee_Id") REFERENCES "public"."Employee" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
|
||||
CONSTRAINT "fk_Registration_Installation" FOREIGN KEY ("Installation_Code") REFERENCES "public"."Installation" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION
|
||||
);
|
||||
@@ -0,0 +1,2 @@
|
||||
-- Modify "Person" table
|
||||
ALTER TABLE "public"."Person" ADD COLUMN "BirthPlace" text NULL;
|
||||
@@ -0,0 +1,14 @@
|
||||
-- Create "Registrator" table
|
||||
CREATE TABLE "public"."Registrator" (
|
||||
"Id" bigserial NOT NULL,
|
||||
"CreatedAt" timestamptz NULL,
|
||||
"UpdatedAt" timestamptz NULL,
|
||||
"DeletedAt" timestamptz NULL,
|
||||
"Employee_Id" bigint NULL,
|
||||
"Installation_Code" character varying(20) NULL,
|
||||
PRIMARY KEY ("Id"),
|
||||
CONSTRAINT "fk_Registrator_Employee" FOREIGN KEY ("Employee_Id") REFERENCES "public"."Employee" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
|
||||
CONSTRAINT "fk_Registrator_Installation" FOREIGN KEY ("Installation_Code") REFERENCES "public"."Installation" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION
|
||||
);
|
||||
-- Drop "Registration" table
|
||||
DROP TABLE "public"."Registration";
|
||||
@@ -0,0 +1,2 @@
|
||||
-- Modify "User" table
|
||||
ALTER TABLE "public"."User" ALTER COLUMN "Name" TYPE character varying(50);
|
||||
@@ -0,0 +1,36 @@
|
||||
-- Modify "Specialist" table
|
||||
ALTER TABLE "public"."Specialist" DROP COLUMN "Unit_Code";
|
||||
-- Rename a column from "SrcUnit_Code" to "Specialist_Code"
|
||||
ALTER TABLE "public"."Chemo" RENAME COLUMN "SrcUnit_Code" TO "Specialist_Code";
|
||||
-- Modify "Chemo" table
|
||||
ALTER TABLE "public"."Chemo" DROP CONSTRAINT "fk_Chemo_SrcUnit", ADD CONSTRAINT "fk_Chemo_Specialist" FOREIGN KEY ("Specialist_Code") REFERENCES "public"."Specialist" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION;
|
||||
-- Modify "Doctor" table
|
||||
ALTER TABLE "public"."Doctor" DROP COLUMN "Unit_Code";
|
||||
-- Rename a column from "DstUnit_Code" to "Specialist_Code"
|
||||
ALTER TABLE "public"."Consultation" RENAME COLUMN "DstUnit_Code" TO "Specialist_Code";
|
||||
-- Rename a column from "DstDoctor_Code" to "Doctor_Code"
|
||||
ALTER TABLE "public"."Consultation" RENAME COLUMN "DstDoctor_Code" TO "Doctor_Code";
|
||||
-- Modify "Consultation" table
|
||||
ALTER TABLE "public"."Consultation" DROP CONSTRAINT "fk_Consultation_DstDoctor", DROP CONSTRAINT "fk_Consultation_DstUnit", ADD CONSTRAINT "fk_Consultation_Doctor" FOREIGN KEY ("Doctor_Code") REFERENCES "public"."Doctor" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION, ADD CONSTRAINT "fk_Consultation_Specialist" FOREIGN KEY ("Specialist_Code") REFERENCES "public"."Specialist" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION;
|
||||
-- Rename a column from "Unit_Code" to "Specialist_Code"
|
||||
ALTER TABLE "public"."InternalReference" RENAME COLUMN "Unit_Code" TO "Specialist_Code";
|
||||
-- Modify "InternalReference" table
|
||||
ALTER TABLE "public"."InternalReference" DROP CONSTRAINT "fk_InternalReference_Unit", ADD CONSTRAINT "fk_InternalReference_Specialist" FOREIGN KEY ("Specialist_Code") REFERENCES "public"."Specialist" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION;
|
||||
-- Rename a column from "Unit_Code" to "Specialist_Code"
|
||||
ALTER TABLE "public"."Nurse" RENAME COLUMN "Unit_Code" TO "Specialist_Code";
|
||||
-- Modify "Nurse" table
|
||||
ALTER TABLE "public"."Nurse" DROP CONSTRAINT "fk_Nurse_Unit", ADD CONSTRAINT "fk_Nurse_Specialist" FOREIGN KEY ("Specialist_Code") REFERENCES "public"."Specialist" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION;
|
||||
-- Rename a column from "Unit_Code" to "Specialist_Code"
|
||||
ALTER TABLE "public"."PracticeSchedule" RENAME COLUMN "Unit_Code" TO "Specialist_Code";
|
||||
-- Modify "PracticeSchedule" table
|
||||
ALTER TABLE "public"."PracticeSchedule" DROP CONSTRAINT "fk_PracticeSchedule_Unit", ADD CONSTRAINT "fk_PracticeSchedule_Specialist" FOREIGN KEY ("Specialist_Code") REFERENCES "public"."Specialist" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION;
|
||||
-- Modify "ControlLetter" table
|
||||
ALTER TABLE "public"."ControlLetter" DROP COLUMN "Unit_Code";
|
||||
-- Modify "Encounter" table
|
||||
ALTER TABLE "public"."Encounter" DROP COLUMN "Unit_Code";
|
||||
-- Modify "ProcedureRoom" table
|
||||
ALTER TABLE "public"."ProcedureRoom" DROP COLUMN "Unit_Code";
|
||||
-- Drop "UnitPosition" table
|
||||
DROP TABLE "public"."UnitPosition";
|
||||
-- Drop "Unit" table
|
||||
DROP TABLE "public"."Unit";
|
||||
@@ -0,0 +1,4 @@
|
||||
-- Modify "Subspecialist" table
|
||||
ALTER TABLE "public"."Subspecialist" ALTER COLUMN "Name" TYPE character varying(100);
|
||||
-- Modify "Specialist" table
|
||||
ALTER TABLE "public"."Specialist" ADD COLUMN "Installation_Code" character varying(20) NULL, ADD CONSTRAINT "fk_Specialist_Installation" FOREIGN KEY ("Installation_Code") REFERENCES "public"."Installation" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION;
|
||||
@@ -1,4 +1,4 @@
|
||||
h1:qwmr55vd65DmAFMwH9uQ5sPXIoKGuFngxaRfnlonWvQ=
|
||||
h1:IfSOZ5RxGCWboRtqCJrYxCJa1HYSrlROJLXcElq1P3I=
|
||||
20250904105930.sql h1:MEM6blCgke9DzWQSTnLzasbPIrcHssNNrJqZpSkEo6k=
|
||||
20250904141448.sql h1:J8cmYNk4ZrG9fhfbi2Z1IWz7YkfvhFqTzrLFo58BPY0=
|
||||
20250908062237.sql h1:Pu23yEW/aKkwozHoOuROvHS/GK4ngARJGdO7FB7HZuI=
|
||||
@@ -149,9 +149,17 @@ h1:qwmr55vd65DmAFMwH9uQ5sPXIoKGuFngxaRfnlonWvQ=
|
||||
20251205211957.sql h1:3fvtZ/mBWsTIXllXMFOuCLJsp4MivVP56dunehlU0yo=
|
||||
20251205214433.sql h1:rn3++FEfX7ntcJcOmCEuOMnr27TZqH0KMGRppzFwFTc=
|
||||
20251205221124.sql h1:CRruUvGZqlVDBmbQSVEl4wFm+uq30AurMMDI6sb8jxg=
|
||||
20251207020537.sql h1:JspoBMoP1Yk854vtNniepvATINUpODQ9idKiMkNL0OU=
|
||||
20251207212015.sql h1:pEH0+QnQ5WXNizxcToLk+8XYaAb6q6WJ1/MJViRVtNQ=
|
||||
20251207221222.sql h1:gpl3V4/3AGqO3WLCpWW2GAtwuhpmNuBqXMiP61wVHX0=
|
||||
20251209022744.sql h1:r0JbZyReQdcbpjPsWxhKQBIOH9SSZGB1fNySqjbvZpU=
|
||||
20251209025908.sql h1:UwyF/B49kyahd2U1Pa+2TjJCj/PszQ3HBHqAzMZnQYc=
|
||||
20251209051742.sql h1:m/k1ul9S4CjuHstP48Fb+58RnUV3jttAB7lvg9Tbp+o=
|
||||
20251206021053.sql h1:bpuEocu4lOhZ7oLuxd//22dzjfNgU2iaWEqSD1mVwoU=
|
||||
20251207020537.sql h1:m6uh4NHVF3EKNTVMqOmuBSDFD9oCQk5mAwo05fT46G4=
|
||||
20251207212015.sql h1:UPelYGTeUR6rm8mU8dfNzgRDEDun0UQ4tkgsaDljn30=
|
||||
20251207221222.sql h1:bTfUCvCf2UPh+BA2IY2PHQafb9DwY9nhH5FRuMEHy+0=
|
||||
20251209022744.sql h1:y5/PAiZH/fYCpDJpkQdNRJwWICHH2iNIwM1V+S1P6KA=
|
||||
20251209025908.sql h1:p3kZA8kyEj+mQZSrdY3k2K1NojQzFJh/MlZJ0Oy6t/k=
|
||||
20251209030538.sql h1:zltV6/Fu2zJW0/lVBl7MdnWuJcqNTUIRcqYYZ8Fi1wo=
|
||||
20251209051742.sql h1:BBNSmWfkamWrcKdxWjPiBS9yJ8yyQQUQIj3kip53nuE=
|
||||
20251209064304.sql h1:Xs73yQbuJvuQ0OnW1FAZpeytmUl/bGTlJFrwGOsTF4w=
|
||||
20251209070128.sql h1:fPGE6xOV6uCiVOqnvwn2L/GsBbgp2wxgmZOhF3bSGGM=
|
||||
20251209084929.sql h1:u4LPMvkGAH4RfGC2IlBTIm7T7paMHoBSvTQ0w5Br7d0=
|
||||
20251210145148.sql h1:rejGrnTpaygxPv06v0vxMytF4rk1OJBXaw3ttSmidgc=
|
||||
20251211101547.sql h1:+jT5yRCEsSRExzoawrqymS/I7lVfwUQQSgSzbxCxgRk=
|
||||
20251211113942.sql h1:F8go8XaJf4GFa4RuoMlo4U/NtbDtbDkVYHZOJz7GYhM=
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
a "github.com/karincake/apem"
|
||||
|
||||
h "simrs-vx/internal/interface/simgos-sync-handler"
|
||||
|
||||
a "github.com/karincake/apem"
|
||||
|
||||
d "github.com/karincake/apem/db-gorm-pg"
|
||||
|
||||
l "github.com/karincake/apem/logger-zerolog"
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
-- Create "DoctorLink" table
|
||||
CREATE TABLE "public"."DoctorLink" (
|
||||
"Id" bigserial NOT NULL,
|
||||
"CreatedAt" timestamptz NULL,
|
||||
"UpdatedAt" timestamptz NULL,
|
||||
"DeletedAt" timestamptz NULL,
|
||||
"Simx_Id" bigint NULL,
|
||||
"Simgos_Id" bigint NULL,
|
||||
PRIMARY KEY ("Id"),
|
||||
CONSTRAINT "uni_DoctorLink_Simgos_Id" UNIQUE ("Simgos_Id"),
|
||||
CONSTRAINT "uni_DoctorLink_Simx_Id" UNIQUE ("Simx_Id")
|
||||
);
|
||||
-- Create "DoctorSimgosLog" table
|
||||
CREATE TABLE "public"."DoctorSimgosLog" (
|
||||
"Id" bigserial NOT NULL,
|
||||
"CreatedAt" timestamptz NULL,
|
||||
"UpdatedAt" timestamptz NULL,
|
||||
"DeletedAt" timestamptz NULL,
|
||||
"Value" text NULL,
|
||||
"Date" timestamptz NULL,
|
||||
"Status" text NULL,
|
||||
"ErrMessage" text NULL,
|
||||
PRIMARY KEY ("Id")
|
||||
);
|
||||
-- Create "DoctorSimxLog" table
|
||||
CREATE TABLE "public"."DoctorSimxLog" (
|
||||
"Id" bigserial NOT NULL,
|
||||
"CreatedAt" timestamptz NULL,
|
||||
"UpdatedAt" timestamptz NULL,
|
||||
"DeletedAt" timestamptz NULL,
|
||||
"Value" text NULL,
|
||||
"Date" timestamptz NULL,
|
||||
"Status" text NULL,
|
||||
"ErrMessage" text NULL,
|
||||
PRIMARY KEY ("Id")
|
||||
);
|
||||
-- Create "NurseLink" table
|
||||
CREATE TABLE "public"."NurseLink" (
|
||||
"Id" bigserial NOT NULL,
|
||||
"CreatedAt" timestamptz NULL,
|
||||
"UpdatedAt" timestamptz NULL,
|
||||
"DeletedAt" timestamptz NULL,
|
||||
"Simx_Id" bigint NULL,
|
||||
"Simgos_Id" bigint NULL,
|
||||
PRIMARY KEY ("Id"),
|
||||
CONSTRAINT "uni_NurseLink_Simgos_Id" UNIQUE ("Simgos_Id"),
|
||||
CONSTRAINT "uni_NurseLink_Simx_Id" UNIQUE ("Simx_Id")
|
||||
);
|
||||
-- Create "NurseSimgosLog" table
|
||||
CREATE TABLE "public"."NurseSimgosLog" (
|
||||
"Id" bigserial NOT NULL,
|
||||
"CreatedAt" timestamptz NULL,
|
||||
"UpdatedAt" timestamptz NULL,
|
||||
"DeletedAt" timestamptz NULL,
|
||||
"Value" text NULL,
|
||||
"Date" timestamptz NULL,
|
||||
"Status" text NULL,
|
||||
"ErrMessage" text NULL,
|
||||
PRIMARY KEY ("Id")
|
||||
);
|
||||
-- Create "NurseSimxLog" table
|
||||
CREATE TABLE "public"."NurseSimxLog" (
|
||||
"Id" bigserial NOT NULL,
|
||||
"CreatedAt" timestamptz NULL,
|
||||
"UpdatedAt" timestamptz NULL,
|
||||
"DeletedAt" timestamptz NULL,
|
||||
"Value" text NULL,
|
||||
"Date" timestamptz NULL,
|
||||
"Status" text NULL,
|
||||
"ErrMessage" text NULL,
|
||||
PRIMARY KEY ("Id")
|
||||
);
|
||||
@@ -1,8 +1,9 @@
|
||||
h1:6YZBXq/r79I5tuYyY1+CBzhZsSeukHSs8MyHCC5QuV4=
|
||||
h1:V6uRNFb6js/aPft2hebJMA8tI0YJc4BuZ7Rlp56FV00=
|
||||
20251113035508.sql h1:rjDlu6yDdy5xv6nrCOr7NialrLSLT23pzduYNq29Hf0=
|
||||
20251114071129.sql h1:Z0GQ5bJo3C+tplaWzxT8n3J9HLkEaVsRVp5nn7bmYow=
|
||||
20251117041601.sql h1:l/RPG5mObqCSBjO4mzG+wTq2ieSycvlfOSz4czpUdWY=
|
||||
20251118082246.sql h1:xLUwA+EvKWIg3X/TJvu7rqbtBzONiINfag5NJpMV29E=
|
||||
20251118082915.sql h1:hP6FmUVFuADIN2cDg2Z1l7Wx7PQRb+IYQDvKD7J8VAM=
|
||||
20251126115527.sql h1:Bvg+Y7k+h5s+/UaezUyJb7J7uzEJS7U5Z/RoCixcUtI=
|
||||
20251201093443.sql h1:m18tksKG3OzbkxXkhfKUUqbkxnJ0VBPi3Cw34Tbywyc=
|
||||
20251201093443.sql h1:dyiD1WzU9D6RjGhF0AtGfGLEsG6yocuk3HbcZWt9ZRQ=
|
||||
20251209083238.sql h1:GmnvITp+vr3sYlWmPxWVxMnjSIRI0QKmv9i202kRgp4=
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
package vclaimsepcontrolletter
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
|
||||
pu "simrs-vx/pkg/use-case-helper"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
@@ -9,6 +15,7 @@ type CreateDto struct {
|
||||
Number *string `json:"number" gorm:"unique;size:20"`
|
||||
Value *string `json:"value"`
|
||||
FileUrl *string `json:"fileUrl" gorm:"unique;size:1024"`
|
||||
RequestPayload string `json:"requestPayload" validate:"maxLength=1024"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
@@ -69,3 +76,49 @@ func ToResponseList(data []VclaimSepControlLetter) []ResponseDto {
|
||||
}
|
||||
return resp
|
||||
}
|
||||
|
||||
func (c CreateDto) RequestPayloadIntoJson() ([]byte, error) {
|
||||
payload := map[string]interface{}{}
|
||||
err := json.Unmarshal([]byte(c.RequestPayload), &payload)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return json.Marshal(payload)
|
||||
}
|
||||
|
||||
type ResponseForPDF struct {
|
||||
Number string `json:"noSuratKontrol"`
|
||||
PlannedControlDate string `json:"tglRencanaKontrol"`
|
||||
IssuedDate string `json:"tglTerbit"`
|
||||
Doctor_Name string `json:"namaDokter"`
|
||||
DstUnit_Name string `json:"namaPoliTujuan"`
|
||||
ResponsibleDoctor_Name string `json:"namaDokterPembuat"`
|
||||
VclaimSep VclaimSep `json:"sep"`
|
||||
}
|
||||
|
||||
type VclaimSep struct {
|
||||
VclaimMember VclaimMember `json:"peserta"`
|
||||
Diagnose string `json:"diagnosa"`
|
||||
Number string `json:"noSep"`
|
||||
}
|
||||
|
||||
type VclaimMember struct {
|
||||
CardNumber string `json:"noKartu"`
|
||||
Name string `json:"nama"`
|
||||
BirthDate string `json:"tglLahir"`
|
||||
Gender string `json:"kelamin"`
|
||||
}
|
||||
|
||||
func (v ResponseForPDF) GenerateNameWithGender() string {
|
||||
gender := "Perempuan"
|
||||
if v.VclaimSep.VclaimMember.Gender == "L" {
|
||||
gender = "Laki-Laki"
|
||||
}
|
||||
|
||||
return fmt.Sprintf("%s (%s)", v.VclaimSep.VclaimMember.Name, gender)
|
||||
}
|
||||
|
||||
func (v ResponseForPDF) GenerateBirthDate() string {
|
||||
t, _ := time.Parse("2006-01-02", v.VclaimSep.VclaimMember.BirthDate)
|
||||
return pu.FormatIndonesianDate(t)
|
||||
}
|
||||
|
||||
@@ -1,90 +0,0 @@
|
||||
package actionreport
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ee "simrs-vx/internal/domain/main-entities/encounter"
|
||||
"time"
|
||||
|
||||
pa "simrs-vx/internal/lib/auth"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Encounter_Id uint64 `json:"encounter_id" validate:"required"`
|
||||
Date *time.Time `json:"date" validate:"required"`
|
||||
Doctor_Code string `json:"doctor_code" validate:"required"`
|
||||
Operator_Employe_Id uint `json:"operator_employe_id" validate:"required"`
|
||||
Assistant_Employe_Id uint `json:"assistant_employe_id" validate:"required"`
|
||||
Instrumentor_Employe_Id uint `json:"instrumentor_employe_id" validate:"required"`
|
||||
Diagnose *string `json:"diagnose"`
|
||||
Nurse_Code string `json:"nurse_code" validate:"required"`
|
||||
Value string `json:"value" validate:"required"`
|
||||
|
||||
pa.AuthInfo
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Encounter_Id *uint `json:"encounter-id"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
}
|
||||
|
||||
type UpdateDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
CreateDto
|
||||
}
|
||||
|
||||
type DeleteDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
}
|
||||
|
||||
type MetaDto struct {
|
||||
PageNumber int `json:"page_number"`
|
||||
PageSize int `json:"page_size"`
|
||||
Count int `json:"count"`
|
||||
}
|
||||
|
||||
type ResponseDto struct {
|
||||
ecore.Main
|
||||
Encounter_Id uint64 `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty"`
|
||||
Date *time.Time `json:"date"`
|
||||
Doctor_Code string `json:"doctor_code"`
|
||||
Operator_Employe_Id uint `json:"operator_employe_id"`
|
||||
Assistant_Employe_Id uint `json:"assistant_employe_id"`
|
||||
Instrumentor_Employe_Id uint `json:"instrumentor_employe_id"`
|
||||
Diagnose *string `json:"diagnose"`
|
||||
Nurse_Code string `json:"nurse_code"`
|
||||
Value *string `json:"value"`
|
||||
}
|
||||
|
||||
func (d ActionReport) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Encounter_Id: d.Encounter_Id,
|
||||
Encounter: d.Encounter,
|
||||
Date: d.Date,
|
||||
Doctor_Code: d.Doctor_Code,
|
||||
Operator_Employe_Id: d.Operator_Employe_Id,
|
||||
Assistant_Employe_Id: d.Assistant_Employe_Id,
|
||||
Instrumentor_Employe_Id: d.Instrumentor_Employe_Id,
|
||||
Nurse_Code: d.Nurse_Code,
|
||||
Value: &d.Value,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []ActionReport) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
package actionreport
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ed "simrs-vx/internal/domain/main-entities/doctor"
|
||||
eem "simrs-vx/internal/domain/main-entities/employee"
|
||||
ee "simrs-vx/internal/domain/main-entities/encounter"
|
||||
en "simrs-vx/internal/domain/main-entities/nurse"
|
||||
"time"
|
||||
)
|
||||
|
||||
type ActionReport struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Encounter_Id uint64 `json:"encounter_id" gorm:"foreignKey"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
|
||||
Date *time.Time `json:"date" gorm:"not null;size:20"`
|
||||
Doctor_Code string `json:"doctor_code" gorm:"size:10"`
|
||||
Doctor *ed.Doctor `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Code;references:Code"`
|
||||
Operator_Employe_Id uint `json:"operator_employe_id"`
|
||||
Operator_Employe *eem.Employee `json:"operator_employe,omitempty" gorm:"foreignKey:Operator_Employe_Id;references:Id"`
|
||||
Assistant_Employe_Id uint `json:"assistant_employe_id"`
|
||||
Instrumentor_Employe_Id uint `json:"instrumentor_employe_id"`
|
||||
Instrumentor_Employe *eem.Employee `json:"instrumentor_employe,omitempty" gorm:"foreignKey:Instrumentor_Employe_Id;references:Id"`
|
||||
Diagnose *string `json:"diagnose" gorm:"size:1024"`
|
||||
Nurse_Code string `json:"nurse_code" gorm:"size:10"`
|
||||
Nurse *en.Nurse `json:"nurse,omitempty" gorm:"foreignKey:Nurse_Code;references:Code"`
|
||||
Value string `json:"value"`
|
||||
// SurgerySize_Code *string `json:"surgerySize_code" gorm:"size:10"`
|
||||
// Billing_Code *string `json:"billing_code" gorm:"size:10"`
|
||||
// SurgerySystem_Code *string `json:"surgerySystem_code" gorm:"size:10"`
|
||||
// StartAt *string `json:"startAt" gorm:"size:20"`
|
||||
// EndAt *string `json:"endAt" gorm:"size:20"`
|
||||
// AnesthesiaStartAt *string `json:"anesthesiaStartAt" gorm:"size:20"`
|
||||
// AnesthesiaEndAt *string `json:"anesthesiaEndAt" gorm:"size:20"`
|
||||
// SurgeryType_Code *string `json:"surgeryType_code" gorm:"size:10"`
|
||||
// SurgeryStage_Code *string `json:"surgeryStage_code" gorm:"size:10"`
|
||||
// BornMortality_Code *string `json:"bornMortality_code" gorm:"size:10"`
|
||||
// BornLocation_Code *string `json:"bornLocation_code" gorm:"size:10"`
|
||||
// Weight *string `json:"weight" gorm:"size:10"`
|
||||
// BornNotes *string `json:"bornNotes" gorm:"size:1024"`
|
||||
// Description *string `json:"notes" gorm:"size:1024"`
|
||||
// BleedingAmount *uint16 `json:"bleedingAmount" gorm:"size:10"`
|
||||
// BloodInType_Code *string `json:"bloodInType_code" gorm:"size:10"`
|
||||
// BloodInAmount *uint16 `json:"bloodInAmount" gorm:"size:10"`
|
||||
// Brand *string `json:"brand" gorm:"size:100"`
|
||||
// ImplantName *string `json:"implantName" gorm:"size:100"`
|
||||
// ImplantRegisterNumber *string `json:"implantRegisterNumber" gorm:"size:100"`
|
||||
// ImplantCompanionName *string `json:"implantCompanionName" gorm:"size:100"`
|
||||
// SpecimentDest_Code *string `json:"specimentDest" gorm:"size:100"`
|
||||
// TissueInfo *string `json:"tissueInfo" gorm:"size:100"`
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package chemo
|
||||
|
||||
import (
|
||||
ed "simrs-vx/internal/domain/main-entities/doctor"
|
||||
es "simrs-vx/internal/domain/main-entities/specialist"
|
||||
ere "simrs-vx/internal/domain/references/encounter"
|
||||
|
||||
// std
|
||||
@@ -16,15 +17,14 @@ import (
|
||||
// internal - domain - main-entities
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ee "simrs-vx/internal/domain/main-entities/encounter"
|
||||
eun "simrs-vx/internal/domain/main-entities/unit"
|
||||
eus "simrs-vx/internal/domain/main-entities/user"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Status_Code erc.DataVerifiedCode `json:"status_code"`
|
||||
SrcUnit_Code *string `json:"srcUnit_code"`
|
||||
Class_Code ere.ChemoClassCode `json:"class_code"`
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Status_Code erc.DataVerifiedCode `json:"status_code"`
|
||||
Specialist_Code *string `json:"specialist_code"`
|
||||
Class_Code ere.ChemoClassCode `json:"class_code"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
@@ -37,7 +37,7 @@ type FilterDto struct {
|
||||
Encounter_Id *uint `json:"encounter-id"`
|
||||
Status_Code *erc.DataVerifiedCode `json:"status-code"`
|
||||
VerifiedBy_User_Id *uint `json:"verifiedBy-user-id"`
|
||||
SrcUnit_Code *string `json:"srcUnit-code"`
|
||||
Specialist_Code *string `json:"specialist-code"`
|
||||
Patient_Id *uint `json:"patient-id"`
|
||||
}
|
||||
|
||||
@@ -81,8 +81,8 @@ type ResponseDto struct {
|
||||
VerifiedAt *time.Time `json:"verifiedAt"`
|
||||
VerifiedBy_User_Id *uint `json:"verifiedBy_user_id"`
|
||||
VerifiedBy *eus.User `json:"verifiedBy,omitempty"`
|
||||
SrcUnit_Code *string `json:"srcUnit_code"`
|
||||
SrcUnit *eun.Unit `json:"srcUnit,omitempty"`
|
||||
Specialist_Code *string `json:"specialist_code"`
|
||||
Specialist *es.Specialist `json:"specialist,omitempty"`
|
||||
Doctor_Code *string `json:"doctor_code"`
|
||||
Doctor *ed.Doctor `json:"doctor,omitempty"`
|
||||
NextChemoDate *time.Time `json:"nextChemoDate"`
|
||||
@@ -96,8 +96,8 @@ func (d Chemo) ToResponse() ResponseDto {
|
||||
VerifiedAt: d.VerifiedAt,
|
||||
VerifiedBy_User_Id: d.VerifiedBy_User_Id,
|
||||
VerifiedBy: d.VerifiedBy,
|
||||
SrcUnit_Code: d.SrcUnit_Code,
|
||||
SrcUnit: d.SrcUnit,
|
||||
Specialist_Code: d.Specialist_Code,
|
||||
Specialist: d.Specialist,
|
||||
Doctor_Code: d.Doctor_Code,
|
||||
Doctor: d.Doctor,
|
||||
NextChemoDate: d.NextChemoDate,
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
ed "simrs-vx/internal/domain/main-entities/doctor"
|
||||
ee "simrs-vx/internal/domain/main-entities/encounter"
|
||||
eun "simrs-vx/internal/domain/main-entities/unit"
|
||||
es "simrs-vx/internal/domain/main-entities/specialist"
|
||||
eus "simrs-vx/internal/domain/main-entities/user"
|
||||
)
|
||||
|
||||
@@ -21,8 +21,8 @@ type Chemo struct {
|
||||
VerifiedAt *time.Time `json:"verifiedAt"`
|
||||
VerifiedBy_User_Id *uint `json:"verifiedBy_user_id"`
|
||||
VerifiedBy *eus.User `json:"verifiedBy,omitempty" gorm:"foreignKey:VerifiedBy_User_Id;references:Id"`
|
||||
SrcUnit_Code *string `json:"src_unit_code"` // klinik asal
|
||||
SrcUnit *eun.Unit `json:"src_unit,omitempty" gorm:"foreignKey:SrcUnit_Code;references:Code"`
|
||||
Specialist_Code *string `json:"specialist_code"` // klinik asal
|
||||
Specialist *es.Specialist `json:"specialist,omitempty" gorm:"foreignKey:Specialist_Code;references:Code"`
|
||||
Bed *string `json:"bed" gorm:"size:1024"`
|
||||
Needs *string `json:"needs" gorm:"size:2048"`
|
||||
Doctor_Code *string `json:"doctor_code"`
|
||||
|
||||
@@ -13,14 +13,14 @@ import (
|
||||
// internal - domain - main-entities
|
||||
ed "simrs-vx/internal/domain/main-entities/doctor"
|
||||
ee "simrs-vx/internal/domain/main-entities/encounter"
|
||||
eu "simrs-vx/internal/domain/main-entities/unit"
|
||||
es "simrs-vx/internal/domain/main-entities/specialist"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Date *time.Time `json:"date"`
|
||||
Problem *string `json:"problem" validate:"maxLength=10240"`
|
||||
DstUnit_Code *string `json:"dstUnit_code"`
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Date *time.Time `json:"date"`
|
||||
Problem *string `json:"problem" validate:"maxLength=10240"`
|
||||
Specialist_Code *string `json:"dstSpecialist_code"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
@@ -30,9 +30,9 @@ type ReadListDto struct {
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Encounter_Id *uint `json:"encounter-id"`
|
||||
DstUnit_Code *string `json:"dstUnit-code"`
|
||||
DstDoctor_Code *string `json:"dstDoctor-code"`
|
||||
Encounter_Id *uint `json:"encounter-id"`
|
||||
Specialist_Code *string `json:"dstSpecialist-code"`
|
||||
Doctor_Code *string `json:"doctor-code"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
@@ -63,29 +63,29 @@ type MetaDto struct {
|
||||
|
||||
type ResponseDto struct {
|
||||
ecore.Main
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty"`
|
||||
Date *time.Time `json:"date"`
|
||||
Problem *string `json:"problem"`
|
||||
Solution *string `json:"solution"`
|
||||
DstUnit_Code *string `json:"dstUnit_code"`
|
||||
DstUnit *eu.Unit `json:"dstUnit,omitempty"`
|
||||
DstDoctor_Code *string `json:"dstDoctor_code"`
|
||||
DstDoctor *ed.Doctor `json:"dstDoctor,omitempty"`
|
||||
RepliedAt *time.Time `json:"repliedAt"`
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty"`
|
||||
Date *time.Time `json:"date"`
|
||||
Problem *string `json:"problem"`
|
||||
Solution *string `json:"solution"`
|
||||
Specialist_Code *string `json:"specialist_code"`
|
||||
Specialist *es.Specialist `json:"specialist,omitempty"`
|
||||
Doctor_Code *string `json:"doctor_code"`
|
||||
Doctor *ed.Doctor `json:"doctor,omitempty"`
|
||||
RepliedAt *time.Time `json:"repliedAt"`
|
||||
}
|
||||
|
||||
func (d Consultation) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Encounter_Id: d.Encounter_Id,
|
||||
Encounter: d.Encounter,
|
||||
Date: d.Date,
|
||||
Problem: d.Problem,
|
||||
Solution: d.Solution,
|
||||
DstUnit_Code: d.DstUnit_Code,
|
||||
DstUnit: d.DstUnit,
|
||||
DstDoctor_Code: d.DstDoctor_Code,
|
||||
DstDoctor: d.DstDoctor,
|
||||
Encounter_Id: d.Encounter_Id,
|
||||
Encounter: d.Encounter,
|
||||
Date: d.Date,
|
||||
Problem: d.Problem,
|
||||
Solution: d.Solution,
|
||||
Specialist_Code: d.Specialist_Code,
|
||||
Specialist: d.Specialist,
|
||||
Doctor_Code: d.Doctor_Code,
|
||||
Doctor: d.Doctor,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ed "simrs-vx/internal/domain/main-entities/doctor"
|
||||
ee "simrs-vx/internal/domain/main-entities/encounter"
|
||||
eu "simrs-vx/internal/domain/main-entities/unit"
|
||||
es "simrs-vx/internal/domain/main-entities/specialist"
|
||||
)
|
||||
|
||||
type Consultation struct {
|
||||
@@ -15,11 +15,11 @@ type Consultation struct {
|
||||
Encounter *ee.Encounter `json:"encounter" gorm:"foreignKey:Encounter_Id;references:Id"`
|
||||
Date *time.Time `json:"date"`
|
||||
|
||||
Problem *string `json:"case" gorm:"size:10240"`
|
||||
Solution *string `json:"solution" gorm:"size:10240"`
|
||||
DstUnit_Code *string `json:"dstUnit_code"`
|
||||
DstUnit *eu.Unit `json:"dstUnit" gorm:"foreignKey:DstUnit_Code;references:Code"`
|
||||
DstDoctor_Code *string `json:"dstDoctor_code"`
|
||||
DstDoctor *ed.Doctor `json:"dstDoctor" gorm:"foreignKey:DstDoctor_Code;references:Code"`
|
||||
RepliedAt *time.Time `json:"repliedAt"`
|
||||
Problem *string `json:"case" gorm:"size:10240"`
|
||||
Solution *string `json:"solution" gorm:"size:10240"`
|
||||
Specialist_Code *string `json:"specialist_code"`
|
||||
Specialist *es.Specialist `json:"specialist" gorm:"foreignKey:Specialist_Code;references:Code"`
|
||||
Doctor_Code *string `json:"doctor_code"`
|
||||
Doctor *ed.Doctor `json:"doctor" gorm:"foreignKey:Doctor_Code;references:Code"`
|
||||
RepliedAt *time.Time `json:"repliedAt"`
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@ import (
|
||||
ee "simrs-vx/internal/domain/main-entities/encounter"
|
||||
es "simrs-vx/internal/domain/main-entities/specialist"
|
||||
ess "simrs-vx/internal/domain/main-entities/subspecialist"
|
||||
eu "simrs-vx/internal/domain/main-entities/unit"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
@@ -66,8 +65,6 @@ type ResponseDto struct {
|
||||
ecore.Main
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty"`
|
||||
Unit_Code *string `json:"unit_code"`
|
||||
Unit *eu.Unit `json:"unit,omitempty"`
|
||||
Specialist_Code *string `json:"specialist_code"`
|
||||
Specialist *es.Specialist `json:"specialist,omitempty"`
|
||||
Subspecialist_Code *string `json:"subspecialist_code"`
|
||||
@@ -81,8 +78,6 @@ func (d ControlLetter) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Encounter_Id: d.Encounter_Id,
|
||||
Encounter: d.Encounter,
|
||||
Unit_Code: d.Unit_Code,
|
||||
Unit: d.Unit,
|
||||
Specialist_Code: d.Specialist_Code,
|
||||
Specialist: d.Specialist,
|
||||
Subspecialist_Code: d.Subspecialist_Code,
|
||||
|
||||
@@ -8,15 +8,12 @@ import (
|
||||
ee "simrs-vx/internal/domain/main-entities/encounter"
|
||||
es "simrs-vx/internal/domain/main-entities/specialist"
|
||||
ess "simrs-vx/internal/domain/main-entities/subspecialist"
|
||||
eu "simrs-vx/internal/domain/main-entities/unit"
|
||||
)
|
||||
|
||||
type ControlLetter struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter" gorm:"foreignKey:Encounter_Id;references:Id"`
|
||||
Unit_Code *string `json:"unit_code"`
|
||||
Unit *eu.Unit `json:"unit" gorm:"foreignKey:Unit_Code;references:Code"`
|
||||
Specialist_Code *string `json:"specialist_code"`
|
||||
Specialist *es.Specialist `json:"specialist" gorm:"foreignKey:Specialist_Code;references:Code"`
|
||||
Subspecialist_Code *string `json:"subspecialist_code"`
|
||||
|
||||
@@ -5,7 +5,6 @@ import (
|
||||
ee "simrs-vx/internal/domain/main-entities/employee"
|
||||
es "simrs-vx/internal/domain/main-entities/specialist"
|
||||
ess "simrs-vx/internal/domain/main-entities/subspecialist"
|
||||
eu "simrs-vx/internal/domain/main-entities/unit"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -69,8 +68,6 @@ type ResponseDto struct {
|
||||
Employee *ee.Employee `json:"employee,omitempty"`
|
||||
IHS_Number *string `json:"ihs_number"`
|
||||
SIP_Number *string `json:"sip_number"`
|
||||
Unit_Code *string `json:"unit_code"`
|
||||
Unit *eu.Unit `json:"unit,omitempty"`
|
||||
Specialist_Code *string `json:"specialist_code"`
|
||||
Specialist *es.Specialist `json:"specialist,omitempty" `
|
||||
Subspecialist_Code *string `json:"subspecialist_code"`
|
||||
@@ -84,8 +81,6 @@ func (d Doctor) ToResponse() ResponseDto {
|
||||
Employee: d.Employee,
|
||||
IHS_Number: d.IHS_Number,
|
||||
SIP_Number: d.SIP_Number,
|
||||
Unit_Code: d.Unit_Code,
|
||||
Unit: d.Unit,
|
||||
Specialist_Code: d.Specialist_Code,
|
||||
Specialist: d.Specialist,
|
||||
Subspecialist_Code: d.Subspecialist_Code,
|
||||
|
||||
@@ -5,7 +5,6 @@ import (
|
||||
ee "simrs-vx/internal/domain/main-entities/employee"
|
||||
es "simrs-vx/internal/domain/main-entities/specialist"
|
||||
ess "simrs-vx/internal/domain/main-entities/subspecialist"
|
||||
eu "simrs-vx/internal/domain/main-entities/unit"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -17,8 +16,6 @@ type Doctor struct {
|
||||
IHS_Number *string `json:"ihs_number" gorm:"unique;size:20"`
|
||||
SIP_Number *string `json:"sip_number" gorm:"unique;size:20"`
|
||||
SIP_ExpiredDate *time.Time `json:"sip_expiredDate"`
|
||||
Unit_Code *string `json:"unit_code" gorm:"size:10"`
|
||||
Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Code;references:Code"`
|
||||
Specialist_Code *string `json:"specialist_code" gorm:"size:10"`
|
||||
Specialist *es.Specialist `json:"specialist,omitempty" gorm:"foreignKey:Specialist_Code;references:Code"`
|
||||
Subspecialist_Code *string `json:"subspecialist_code" gorm:"size:10"`
|
||||
|
||||
@@ -30,7 +30,6 @@ import (
|
||||
er "simrs-vx/internal/domain/main-entities/rehab/base"
|
||||
es "simrs-vx/internal/domain/main-entities/specialist"
|
||||
ess "simrs-vx/internal/domain/main-entities/subspecialist"
|
||||
eu "simrs-vx/internal/domain/main-entities/unit"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
@@ -39,7 +38,6 @@ type CreateDto struct {
|
||||
Class_Code ere.EncounterClassCode `json:"class_code" validate:"maxLength=10"`
|
||||
SubClass_Code *string `json:"subClass_code" validate:"maxLength=10"` // for sub
|
||||
Infra_Code *string `json:"infra_code"` // for inpatient
|
||||
Unit_Code *string `json:"unit_code"`
|
||||
Specialist_Code *string `json:"specialist_code"`
|
||||
Subspecialist_Code *string `json:"subspecialist_code"`
|
||||
VisitDate time.Time `json:"visitDate"`
|
||||
@@ -96,7 +94,7 @@ type ReadListDto struct {
|
||||
EndDate *string `json:"end-date"`
|
||||
PaymentMethod_Code *string `json:"paymentMethod-code"`
|
||||
Status_Code *string `json:"status-code"`
|
||||
Unit_Code *string `json:"unit-code"`
|
||||
Specialist_Code *string `json:"specialist-code"`
|
||||
|
||||
pa.AuthInfo
|
||||
}
|
||||
@@ -171,7 +169,7 @@ type CheckinDto struct {
|
||||
pa.AuthInfo
|
||||
}
|
||||
|
||||
type SwitchUnitDto struct {
|
||||
type SwitchSpecialistDto struct {
|
||||
Id uint `json:"id"`
|
||||
PolySwitchCode *ere.PolySwitchCode `json:"polySwitchCode"`
|
||||
InternalReferences *[]eir.CreateDto `json:"internalReferences" validate:"required"`
|
||||
@@ -181,7 +179,7 @@ type SwitchUnitDto struct {
|
||||
pa.AuthInfo
|
||||
}
|
||||
|
||||
type ApproveCancelUnitDto struct {
|
||||
type ApproveCancelSpecialistDto struct {
|
||||
Id uint `json:"id"`
|
||||
InternalReferences_Id uint `json:"internalReferences_id" validate:"required"`
|
||||
Dst_Doctor_Code *string `json:"dst_doctor_code"`
|
||||
@@ -195,12 +193,10 @@ type ResponseDto struct {
|
||||
Patient *ep.Patient `json:"patient,omitempty"`
|
||||
RegisteredAt *time.Time `json:"registeredAt"`
|
||||
Class_Code ere.EncounterClassCode `json:"class_code"`
|
||||
Unit_Code *string `json:"unit_code"`
|
||||
Specialist_Code *string `json:"specialist_code"`
|
||||
Specialist *es.Specialist `json:"specialist,omitempty"`
|
||||
Subspecialist_Code *string `json:"subspecialist_code"`
|
||||
Subspecialist *ess.Subspecialist `json:"subspecialist,omitempty"`
|
||||
Unit *eu.Unit `json:"unit,omitempty"`
|
||||
VisitDate time.Time `json:"visitDate"`
|
||||
PaymentMethod_Code ere.AllPaymentMethodCode `json:"paymentMethod_code"`
|
||||
InsuranceCompany_Code *string `json:"insuranceCompany_code"`
|
||||
@@ -245,8 +241,6 @@ func (d Encounter) ToResponse() ResponseDto {
|
||||
Patient: d.Patient,
|
||||
RegisteredAt: d.RegisteredAt,
|
||||
Class_Code: d.Class_Code,
|
||||
Unit_Code: d.Unit_Code,
|
||||
Unit: d.Unit,
|
||||
Specialist_Code: d.Specialist_Code,
|
||||
Specialist: d.Specialist,
|
||||
Subspecialist_Code: d.Subspecialist_Code,
|
||||
@@ -298,3 +292,8 @@ func ToResponseList(data []Encounter) []ResponseDto {
|
||||
}
|
||||
return resp
|
||||
}
|
||||
|
||||
type CreateWithPatientDto struct {
|
||||
Encounter CreateDto `json:"encounter"`
|
||||
Patient ep.CreateDto `json:"patient"`
|
||||
}
|
||||
|
||||
@@ -25,7 +25,6 @@ import (
|
||||
er "simrs-vx/internal/domain/main-entities/rehab/base"
|
||||
es "simrs-vx/internal/domain/main-entities/specialist"
|
||||
ess "simrs-vx/internal/domain/main-entities/subspecialist"
|
||||
eu "simrs-vx/internal/domain/main-entities/unit"
|
||||
)
|
||||
|
||||
type Encounter struct {
|
||||
@@ -34,8 +33,6 @@ type Encounter struct {
|
||||
Patient *ep.Patient `json:"patient,omitempty" gorm:"foreignKey:Patient_Id;references:Id"`
|
||||
RegisteredAt *time.Time `json:"registeredAt"`
|
||||
Class_Code ere.EncounterClassCode `json:"class_code" gorm:"not null;size:10"`
|
||||
Unit_Code *string `json:"unit_code"`
|
||||
Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Code;references:Code"`
|
||||
Specialist_Code *string `json:"specialist_code"`
|
||||
Specialist *es.Specialist `json:"specialist,omitempty" gorm:"foreignKey:Specialist_Code;references:Code"`
|
||||
Subspecialist_Code *string `json:"subspecialist_code"`
|
||||
|
||||
@@ -5,17 +5,17 @@ import (
|
||||
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ed "simrs-vx/internal/domain/main-entities/doctor"
|
||||
eu "simrs-vx/internal/domain/main-entities/unit"
|
||||
es "simrs-vx/internal/domain/main-entities/specialist"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Encounter_Id *uint `json:"-"`
|
||||
Unit_Code *string `json:"unit_code"`
|
||||
Doctor_Code *string `json:"doctor_code"`
|
||||
Nurse_Code *string `json:"nurse_code"`
|
||||
Status_Code erc.DataApprovalCode `json:"status_code"`
|
||||
SrcDoctor_Code *string `json:"srcDoctor_code"`
|
||||
SrcNurse_Code *string `json:"srcNurse_code"`
|
||||
Encounter_Id *uint `json:"-"`
|
||||
Specialist_Code *string `json:"specialist_code"`
|
||||
Doctor_Code *string `json:"doctor_code"`
|
||||
Nurse_Code *string `json:"nurse_code"`
|
||||
Status_Code erc.DataApprovalCode `json:"status_code"`
|
||||
SrcDoctor_Code *string `json:"srcDoctor_code"`
|
||||
SrcNurse_Code *string `json:"srcNurse_code"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
@@ -25,10 +25,10 @@ type ReadListDto struct {
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Encounter_Id *uint `json:"encounter-id"`
|
||||
Unit_Code *uint `json:"unit-code"`
|
||||
Doctor_Code *uint `json:"doctor-code"`
|
||||
Status_Code erc.DataApprovalCode `json:"status-code"`
|
||||
Encounter_Id *uint `json:"encounter-id"`
|
||||
Specialist_Code *uint `json:"specialist-code"`
|
||||
Doctor_Code *uint `json:"doctor-code"`
|
||||
Status_Code erc.DataApprovalCode `json:"status-code"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
@@ -53,22 +53,22 @@ type MetaDto struct {
|
||||
|
||||
type ResponseDto struct {
|
||||
ecore.Main
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Unit_Code *string `json:"unit_code"`
|
||||
Unit *eu.Unit `json:"unit,omitempty"`
|
||||
Doctor_Code *string `json:"doctor_id"`
|
||||
Doctor *ed.Doctor `json:"doctor,omitempty"`
|
||||
Status_Code *erc.DataApprovalCode `json:"status_code"`
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Specialist_Code *string `json:"specialist_code"`
|
||||
Specialist *es.Specialist `json:"specialist,omitempty"`
|
||||
Doctor_Code *string `json:"doctor_id"`
|
||||
Doctor *ed.Doctor `json:"doctor,omitempty"`
|
||||
Status_Code *erc.DataApprovalCode `json:"status_code"`
|
||||
}
|
||||
|
||||
func (d InternalReference) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Encounter_Id: d.Encounter_Id,
|
||||
Unit_Code: d.Unit_Code,
|
||||
Unit: d.Unit,
|
||||
Doctor_Code: d.Doctor_Code,
|
||||
Doctor: d.Doctor,
|
||||
Status_Code: d.Status_Code,
|
||||
Encounter_Id: d.Encounter_Id,
|
||||
Specialist_Code: d.Specialist_Code,
|
||||
Specialist: d.Specialist,
|
||||
Doctor_Code: d.Doctor_Code,
|
||||
Doctor: d.Doctor,
|
||||
Status_Code: d.Status_Code,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
|
||||
@@ -6,21 +6,21 @@ import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ed "simrs-vx/internal/domain/main-entities/doctor"
|
||||
en "simrs-vx/internal/domain/main-entities/nurse"
|
||||
eu "simrs-vx/internal/domain/main-entities/unit"
|
||||
es "simrs-vx/internal/domain/main-entities/specialist"
|
||||
)
|
||||
|
||||
type InternalReference struct {
|
||||
ecore.Main
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Unit_Code *string `json:"unit_code"`
|
||||
Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Code;references:Code"`
|
||||
Doctor_Code *string `json:"doctor_code"`
|
||||
Doctor *ed.Doctor `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Code;references:Code"`
|
||||
Status_Code *erc.DataApprovalCode `json:"status_code"`
|
||||
SrcDoctor_Code *string `json:"srcDoctor_code"`
|
||||
SrcDoctor *ed.Doctor `json:"srcDoctor,omitempty" gorm:"foreignKey:SrcDoctor_Code;references:Code"`
|
||||
SrcNurse_Code *string `json:"srcNurse_code"`
|
||||
SrcNurse *en.Nurse `json:"srcNurse,omitempty" gorm:"foreignKey:SrcNurse_Code;references:Code"`
|
||||
Nurse_Code *string `json:"nurse_code"`
|
||||
Nurse *en.Nurse `json:"nurse,omitempty" gorm:"foreignKey:Nurse_Code;references:Code"`
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Specialist_Code *string `json:"specialist_code"`
|
||||
Specialist *es.Specialist `json:"specialist,omitempty" gorm:"foreignKey:Specialist_Code;references:Code"`
|
||||
Doctor_Code *string `json:"doctor_code"`
|
||||
Doctor *ed.Doctor `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Code;references:Code"`
|
||||
Status_Code *erc.DataApprovalCode `json:"status_code"`
|
||||
SrcDoctor_Code *string `json:"srcDoctor_code"`
|
||||
SrcDoctor *ed.Doctor `json:"srcDoctor,omitempty" gorm:"foreignKey:SrcDoctor_Code;references:Code"`
|
||||
SrcNurse_Code *string `json:"srcNurse_code"`
|
||||
SrcNurse *en.Nurse `json:"srcNurse,omitempty" gorm:"foreignKey:SrcNurse_Code;references:Code"`
|
||||
Nurse_Code *string `json:"nurse_code"`
|
||||
Nurse *en.Nurse `json:"nurse,omitempty" gorm:"foreignKey:Nurse_Code;references:Code"`
|
||||
}
|
||||
|
||||
@@ -13,6 +13,8 @@ type CreateDto struct {
|
||||
Uom_Code *string `json:"uom_code" validate:"maxLength=10"`
|
||||
Infra_Code *string `json:"infra_code"`
|
||||
Stock *int `json:"stock"`
|
||||
BuyingPrice *float64 `json:"buyingPrice"`
|
||||
SellingPrice *float64 `json:"sellingPrice"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
|
||||
@@ -4,15 +4,15 @@ import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ee "simrs-vx/internal/domain/main-entities/employee"
|
||||
ei "simrs-vx/internal/domain/main-entities/infra"
|
||||
eu "simrs-vx/internal/domain/main-entities/unit"
|
||||
es "simrs-vx/internal/domain/main-entities/specialist"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Code *string `json:"code" validate:"maxLength=20"`
|
||||
Employee_Id *uint `json:"employee_id"`
|
||||
IHS_Number *string `json:"ihs_number" validate:"maxLength=20"`
|
||||
Unit_Code *string `json:"unit_code"`
|
||||
Infra_Code *string `json:"infra_code"`
|
||||
Code *string `json:"code" validate:"maxLength=20"`
|
||||
Employee_Id *uint `json:"employee_id"`
|
||||
IHS_Number *string `json:"ihs_number" validate:"maxLength=20"`
|
||||
Specialist_Code *string `json:"specialist_code"`
|
||||
Infra_Code *string `json:"infra_code"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
@@ -22,11 +22,11 @@ type ReadListDto struct {
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Code *string `json:"code"`
|
||||
Employee_Id *uint `json:"employee-id"`
|
||||
IHS_Number *string `json:"ihs-number"`
|
||||
Unit_Code *string `json:"unit-code"`
|
||||
Infra_Code *string `json:"infra-code"`
|
||||
Code *string `json:"code"`
|
||||
Employee_Id *uint `json:"employee-id"`
|
||||
IHS_Number *string `json:"ihs-number"`
|
||||
Specialist_Code *string `json:"specialist-code"`
|
||||
Infra_Code *string `json:"infra-code"`
|
||||
}
|
||||
type ReadDetailDto struct {
|
||||
Id *uint16 `json:"id"`
|
||||
@@ -53,26 +53,26 @@ type MetaDto struct {
|
||||
|
||||
type ResponseDto struct {
|
||||
ecore.Main
|
||||
Code *string `json:"code"`
|
||||
Employee_Id *uint `json:"employee_id"`
|
||||
Employee *ee.Employee `json:"employee,omitempty"`
|
||||
IHS_Number *string `json:"ihs_number"`
|
||||
Unit_Code *string `json:"unit_code"`
|
||||
Unit *eu.Unit `json:"unit,omitempty"`
|
||||
Infra_Code *string `json:"infra_code"`
|
||||
Infra *ei.Infra `json:"infra,omitempty"`
|
||||
Code *string `json:"code"`
|
||||
Employee_Id *uint `json:"employee_id"`
|
||||
Employee *ee.Employee `json:"employee,omitempty"`
|
||||
IHS_Number *string `json:"ihs_number"`
|
||||
Specialist_Code *string `json:"specialist_code"`
|
||||
Specialist *es.Specialist `json:"specialist,omitempty"`
|
||||
Infra_Code *string `json:"infra_code"`
|
||||
Infra *ei.Infra `json:"infra,omitempty"`
|
||||
}
|
||||
|
||||
func (d Nurse) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Code: d.Code,
|
||||
Employee_Id: d.Employee_Id,
|
||||
Employee: d.Employee,
|
||||
IHS_Number: d.IHS_Number,
|
||||
Unit_Code: d.Unit_Code,
|
||||
Unit: d.Unit,
|
||||
Infra_Code: d.Infra_Code,
|
||||
Infra: d.Infra,
|
||||
Code: d.Code,
|
||||
Employee_Id: d.Employee_Id,
|
||||
Employee: d.Employee,
|
||||
IHS_Number: d.IHS_Number,
|
||||
Specialist_Code: d.Specialist_Code,
|
||||
Specialist: d.Specialist,
|
||||
Infra_Code: d.Infra_Code,
|
||||
Infra: d.Infra,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
|
||||
@@ -4,17 +4,17 @@ import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ee "simrs-vx/internal/domain/main-entities/employee"
|
||||
ei "simrs-vx/internal/domain/main-entities/infra"
|
||||
eu "simrs-vx/internal/domain/main-entities/unit"
|
||||
es "simrs-vx/internal/domain/main-entities/specialist"
|
||||
)
|
||||
|
||||
type Nurse struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Code *string `json:"code" gorm:"unique;size:20"`
|
||||
Employee_Id *uint `json:"employee_id"`
|
||||
Employee *ee.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"`
|
||||
IHS_Number *string `json:"ihs_number" gorm:"unique;size:20"`
|
||||
Unit_Code *string `json:"unit_code" gorm:"size:10"`
|
||||
Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Code;references:Code"`
|
||||
Infra_Code *string `json:"infra_code" gorm:"size:10"`
|
||||
Infra *ei.Infra `json:"infra,omitempty" gorm:"foreignKey:Infra_Code;references:Code"`
|
||||
ecore.Main // adjust this according to the needs
|
||||
Code *string `json:"code" gorm:"unique;size:20"`
|
||||
Employee_Id *uint `json:"employee_id"`
|
||||
Employee *ee.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"`
|
||||
IHS_Number *string `json:"ihs_number" gorm:"unique;size:20"`
|
||||
Specialist_Code *string `json:"specialist_code" gorm:"size:10"`
|
||||
Specialist *es.Specialist `json:"specialist,omitempty" gorm:"foreignKey:Specialist_Code;references:Code"`
|
||||
Infra_Code *string `json:"infra_code" gorm:"size:10"`
|
||||
Infra *ei.Infra `json:"infra,omitempty" gorm:"foreignKey:Infra_Code;references:Code"`
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ type CreateDto struct {
|
||||
FrontTitle *string `json:"frontTitle" validate:"maxLength=50"`
|
||||
EndTitle *string `json:"endTitle" validate:"maxLength=50"`
|
||||
BirthDate *time.Time `json:"birthDate,omitempty"`
|
||||
BirthPlace *string `json:"birthPlace" validate:"maxLength=4"`
|
||||
BirthRegency_Code *string `json:"birthRegency_code" validate:"maxLength=4"`
|
||||
Gender_Code *erp.GenderCode `json:"gender_code"`
|
||||
ResidentIdentityNumber *string `json:"residentIdentityNumber" validate:"nik;maxLength=16"`
|
||||
@@ -46,14 +47,13 @@ type ReadListDto struct {
|
||||
|
||||
type FilterDto struct {
|
||||
Name string `json:"name"`
|
||||
FrontTitle *string `json:"frontTitle"`
|
||||
EndTitle *string `json:"endTitle"`
|
||||
BirthDate *time.Time `json:"birthDate,omitempty"`
|
||||
BirthRegency_Code *string `json:"birthRegency-code"`
|
||||
FrontTitle *string `json:"front-title"`
|
||||
EndTitle *string `json:"end-title"`
|
||||
BirthDate *time.Time `json:"birth-date,omitempty"`
|
||||
Gender_Code *erp.GenderCode `json:"gender-code"`
|
||||
ResidentIdentityNumber *string `json:"residentIdentityNumber"`
|
||||
PassportNumber *string `json:"passportNumber"`
|
||||
DrivingLicenseNumber *string `json:"drivingLicenseNumber"`
|
||||
ResidentIdentityNumber *string `json:"resident-identity-number"`
|
||||
PassportNumber *string `json:"passport-number"`
|
||||
DrivingLicenseNumber *string `json:"driving-license-number"`
|
||||
Religion_Code *erp.ReligionCode `json:"religion-code"`
|
||||
Education_Code *erp.EducationCode `json:"education-code"`
|
||||
Ocupation_Code *erp.OcupationCode `json:"occupation-code"`
|
||||
@@ -61,7 +61,7 @@ type FilterDto struct {
|
||||
Nationality *string `json:"nationality"`
|
||||
Ethnic_Code *string `json:"ethnic-code"`
|
||||
Language_Code *string `json:"language-code"`
|
||||
CommunicationIssueStatus bool `json:"communicationIssueStatus"`
|
||||
CommunicationIssueStatus bool `json:"communication-issue-status"`
|
||||
Disability *string `json:"disability"`
|
||||
}
|
||||
|
||||
@@ -94,6 +94,7 @@ type ResponseDto struct {
|
||||
FrontTitle *string `json:"frontTitle"`
|
||||
EndTitle *string `json:"endTitle"`
|
||||
BirthDate *time.Time `json:"birthDate,omitempty"`
|
||||
BirthPlace *string `json:"birthPlace"`
|
||||
BirthRegency_Code *string `json:"birthRegency_code"`
|
||||
BirthRegency *er.Regency `json:"birthRegency,omitempty"`
|
||||
Gender_Code *erp.GenderCode `json:"gender_code"`
|
||||
@@ -128,6 +129,7 @@ func (d *Person) ToResponse() ResponseDto {
|
||||
FrontTitle: d.FrontTitle,
|
||||
EndTitle: d.EndTitle,
|
||||
BirthDate: d.BirthDate,
|
||||
BirthPlace: d.BirthPlace,
|
||||
BirthRegency_Code: d.BirthRegency_Code,
|
||||
BirthRegency: d.BirthRegency,
|
||||
Gender_Code: d.Gender_Code,
|
||||
|
||||
@@ -23,6 +23,7 @@ type Person struct {
|
||||
FrontTitle *string `json:"frontTitle" gorm:"size:50"`
|
||||
EndTitle *string `json:"endTitle" gorm:"size:50"`
|
||||
BirthDate *time.Time `json:"birthDate,omitempty"`
|
||||
BirthPlace *string `json:"birthPlace,omitempty"`
|
||||
BirthRegency_Code *string `json:"birthRegency_code" gorm:"size:4"`
|
||||
BirthRegency *er.Regency `json:"birthRegency,omitempty" gorm:"foreignKey:BirthRegency_Code;references:Code"`
|
||||
Gender_Code *erp.GenderCode `json:"gender_code" gorm:"size:10"`
|
||||
|
||||
@@ -6,11 +6,11 @@ import (
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Doctor_Code *string `json:"doctor_code"`
|
||||
Unit_Code *string `json:"unit_code"`
|
||||
Day_Code *erc.DayCode `json:"day_code"`
|
||||
StartTime *string `json:"startTime" validate:"maxLength=5"`
|
||||
EndTime *string `json:"endTime" validate:"maxLength=5"`
|
||||
Doctor_Code *string `json:"doctor_code"`
|
||||
Specialist_Code *string `json:"specialist_code"`
|
||||
Day_Code *erc.DayCode `json:"day_code"`
|
||||
StartTime *string `json:"startTime" validate:"maxLength=5"`
|
||||
EndTime *string `json:"endTime" validate:"maxLength=5"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
@@ -20,11 +20,11 @@ type ReadListDto struct {
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Doctor_Code *string `json:"doctor-code"`
|
||||
Unit_Code *string `json:"unit-code"`
|
||||
Day_Code *erc.DayCode `json:"day-code"`
|
||||
StartTime *string `json:"startTime"`
|
||||
EndTime *string `json:"endTime"`
|
||||
Doctor_Code *string `json:"doctor-code"`
|
||||
Specialist_Code *string `json:"specialist-code"`
|
||||
Day_Code *erc.DayCode `json:"day-code"`
|
||||
StartTime *string `json:"startTime"`
|
||||
EndTime *string `json:"endTime"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
@@ -48,20 +48,20 @@ type MetaDto struct {
|
||||
|
||||
type ResponseDto struct {
|
||||
ecore.Main
|
||||
Doctor_Code *string `json:"doctor_code"`
|
||||
Unit_Code *string `json:"unit_code"`
|
||||
Day_Code *erc.DayCode `json:"day_code"`
|
||||
StartTime *string `json:"startTime"`
|
||||
EndTime *string `json:"endTime"`
|
||||
Doctor_Code *string `json:"doctor_code"`
|
||||
Specialist_Code *string `json:"specialist_code"`
|
||||
Day_Code *erc.DayCode `json:"day_code"`
|
||||
StartTime *string `json:"startTime"`
|
||||
EndTime *string `json:"endTime"`
|
||||
}
|
||||
|
||||
func (d PracticeSchedule) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Doctor_Code: d.Doctor_Code,
|
||||
Unit_Code: d.Unit_Code,
|
||||
Day_Code: d.Day_Code,
|
||||
StartTime: d.StartTime,
|
||||
EndTime: d.EndTime,
|
||||
Doctor_Code: d.Doctor_Code,
|
||||
Specialist_Code: d.Specialist_Code,
|
||||
Day_Code: d.Day_Code,
|
||||
StartTime: d.StartTime,
|
||||
EndTime: d.EndTime,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
|
||||
@@ -3,17 +3,17 @@ package practiceschedule
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ed "simrs-vx/internal/domain/main-entities/doctor"
|
||||
eu "simrs-vx/internal/domain/main-entities/unit"
|
||||
es "simrs-vx/internal/domain/main-entities/specialist"
|
||||
erc "simrs-vx/internal/domain/references/common"
|
||||
)
|
||||
|
||||
type PracticeSchedule struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Doctor_Code *string `json:"doctor_code"`
|
||||
Doctor *ed.Doctor `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Code;references:Code"`
|
||||
Unit_Code *string `json:"unit_code"`
|
||||
Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Code;references:Code"`
|
||||
Day_Code *erc.DayCode `json:"day_code"`
|
||||
StartTime *string `json:"startTime" gorm:"size:5"`
|
||||
EndTime *string `json:"endTime" gorm:"size:5"`
|
||||
ecore.Main // adjust this according to the needs
|
||||
Doctor_Code *string `json:"doctor_code"`
|
||||
Doctor *ed.Doctor `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Code;references:Code"`
|
||||
Specialist_Code *string `json:"specialist_code"`
|
||||
Specialist *es.Specialist `json:"specialist,omitempty" gorm:"foreignKey:Specialist_Code;references:Code"`
|
||||
Day_Code *erc.DayCode `json:"day_code"`
|
||||
StartTime *string `json:"startTime" gorm:"size:5"`
|
||||
EndTime *string `json:"endTime" gorm:"size:5"`
|
||||
}
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
package procedurereport
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ee "simrs-vx/internal/domain/main-entities/encounter"
|
||||
"time"
|
||||
|
||||
pa "simrs-vx/internal/lib/auth"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Encounter_Id uint64 `json:"encounter_id" validate:"required"`
|
||||
Date *time.Time `json:"date" validate:"required"`
|
||||
Doctor_Code string `json:"doctor_code" validate:"required"`
|
||||
Operator_Name string `json:"operator_name" validate:"required"`
|
||||
Assistant_Name string `json:"assistant_name" validate:"required"`
|
||||
Instrumentor_Name string `json:"instrumentor_name" validate:"required"`
|
||||
Anesthesia_Doctor_Code *string `json:"anesthesia_doctor_code"`
|
||||
Anesthesia_Nurse_Name *string `json:"anesthesia_nurse_name"`
|
||||
Diagnose *string `json:"diagnose"`
|
||||
Nurse_Name string `json:"nurse_name" validate:"required"`
|
||||
ProcedureValue string `json:"procedure_value" validate:"required"`
|
||||
ExecutionValue string `json:"execution_value" validate:"required"`
|
||||
Type_Code string `json:"type_code" validate:"required"`
|
||||
|
||||
pa.AuthInfo
|
||||
|
||||
// PROPER
|
||||
// Operator_Employe_Id uint `json:"operator_employe_id" validate:"required"`
|
||||
// Assistant_Employe_Id uint `json:"assistant_employe_id" validate:"required"`
|
||||
// Instrumentor_Employe_Id uint `json:"instrumentor_employe_id" validate:"required"`
|
||||
// Anesthesia_Doctor_Code string `json:"anesthesia_doctor_code" validate:"required"`
|
||||
// Anesthesia_Nurse_Employe_Id uint `json:"anesthesia_nurse_employe_id" validate:"required"`
|
||||
// Nurse_Code string `json:"nurse_code" validate:"required"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Encounter_Id *uint `json:"encounter-id"`
|
||||
Type_Code string `json:"type-code"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
}
|
||||
|
||||
type UpdateDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
CreateDto
|
||||
}
|
||||
|
||||
type DeleteDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
}
|
||||
|
||||
type MetaDto struct {
|
||||
PageNumber int `json:"page_number"`
|
||||
PageSize int `json:"page_size"`
|
||||
Count int `json:"count"`
|
||||
}
|
||||
|
||||
type ResponseDto struct {
|
||||
ecore.Main
|
||||
Encounter_Id uint64 `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty"`
|
||||
Date *time.Time `json:"date"`
|
||||
Doctor_Code string `json:"doctor_code"`
|
||||
Operator_Name string `json:"operator_name"`
|
||||
Assistant_Name string `json:"assistant_name"`
|
||||
Instrumentor_Name string `json:"instrumentor_name"`
|
||||
Anesthesia_Doctor_Code *string `json:"anesthesia_doctor_code"`
|
||||
Anesthesia_Nurse_Name *string `json:"anesthesia_nurse_name"`
|
||||
Diagnose *string `json:"diagnose"`
|
||||
Nurse_Name string `json:"nurse_name"`
|
||||
ProcedureValue *string `json:"procedure_value"`
|
||||
ExecutionValue *string `json:"execution_value"`
|
||||
Type_Code string `json:"type_code"`
|
||||
}
|
||||
|
||||
func (d ProcedureReport) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Encounter_Id: d.Encounter_Id,
|
||||
Encounter: d.Encounter,
|
||||
Date: d.Date,
|
||||
Doctor_Code: d.Doctor_Code,
|
||||
Operator_Name: d.Operator_Name,
|
||||
Assistant_Name: d.Assistant_Name,
|
||||
Instrumentor_Name: d.Instrumentor_Name,
|
||||
Anesthesia_Doctor_Code: d.Anesthesia_Doctor_Code,
|
||||
Anesthesia_Nurse_Name: d.Anesthesia_Nurse_Name,
|
||||
Nurse_Name: d.Nurse_Name,
|
||||
ProcedureValue: &d.ProcedureValue,
|
||||
ExecutionValue: &d.ExecutionValue,
|
||||
Type_Code: d.Type_Code,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []ProcedureReport) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package procedurereport
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ed "simrs-vx/internal/domain/main-entities/doctor"
|
||||
ee "simrs-vx/internal/domain/main-entities/encounter"
|
||||
"time"
|
||||
)
|
||||
|
||||
type ProcedureReport struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Encounter_Id uint64 `json:"encounter_id" gorm:"foreignKey"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
|
||||
Date *time.Time `json:"date" gorm:"not null;size:20"`
|
||||
Doctor_Code string `json:"doctor_code" gorm:"size:10"`
|
||||
Doctor *ed.Doctor `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Code;references:Code"`
|
||||
Operator_Name string `json:"operator_name"`
|
||||
Assistant_Name string `json:"assistant_name"`
|
||||
Instrumentor_Name string `json:"instrumentor_name"`
|
||||
Diagnose *string `json:"diagnose" gorm:"size:1024"`
|
||||
Nurse_Name string `json:"nurse_name"`
|
||||
Anesthesia_Doctor_Code *string `json:"anesthesia_doctor_code" gorm:"size:10"`
|
||||
Anesthesia_Doctor *ed.Doctor `json:"anesthesia,omitempty" gorm:"foreignKey:Anesthesia_Doctor_Code;references:Code"`
|
||||
Anesthesia_Nurse_Name *string `json:"anesthesia_nurse_name"`
|
||||
ProcedureValue string `json:"procedure_value"`
|
||||
ExecutionValue string `json:"execution_value"`
|
||||
Type_Code string `json:"type_code"`
|
||||
|
||||
// SurgerySize_Code *string `json:"surgerySize_code" gorm:"size:10"`
|
||||
// Billing_Code *string `json:"billing_code" gorm:"size:10"`
|
||||
// SurgerySystem_Code *string `json:"surgerySystem_code" gorm:"size:10"`
|
||||
// StartAt *string `json:"startAt" gorm:"size:20"`
|
||||
// EndAt *string `json:"endAt" gorm:"size:20"`
|
||||
// AnesthesiaStartAt *string `json:"anesthesiaStartAt" gorm:"size:20"`
|
||||
// AnesthesiaEndAt *string `json:"anesthesiaEndAt" gorm:"size:20"`
|
||||
// SurgeryType_Code *string `json:"surgeryType_code" gorm:"size:10"`
|
||||
// SurgeryStage_Code *string `json:"surgeryStage_code" gorm:"size:10"`
|
||||
// BornMortality_Code *string `json:"bornMortality_code" gorm:"size:10"`
|
||||
// BornLocation_Code *string `json:"bornLocation_code" gorm:"size:10"`
|
||||
// Weight *string `json:"weight" gorm:"size:10"`
|
||||
// BornNotes *string `json:"bornNotes" gorm:"size:1024"`
|
||||
// Description *string `json:"notes" gorm:"size:1024"`
|
||||
// BleedingAmount *uint16 `json:"bleedingAmount" gorm:"size:10"`
|
||||
// BloodInType_Code *string `json:"bloodInType_code" gorm:"size:10"`
|
||||
// BloodInAmount *uint16 `json:"bloodInAmount" gorm:"size:10"`
|
||||
// Brand *string `json:"brand" gorm:"size:100"`
|
||||
// ImplantName *string `json:"implantName" gorm:"size:100"`
|
||||
// ImplantRegisterNumber *string `json:"implantRegisterNumber" gorm:"size:100"`
|
||||
// ImplantCompanionName *string `json:"implantCompanionName" gorm:"size:100"`
|
||||
// SpecimentDest_Code *string `json:"specimentDest" gorm:"size:100"`
|
||||
// TissueInfo *string `json:"tissueInfo" gorm:"size:100"`
|
||||
|
||||
//PROPER
|
||||
// Doctor_Code string `json:"doctor_code" gorm:"size:10"`
|
||||
// Doctor *ed.Doctor `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Code;references:Code"`
|
||||
// Operator_Employe_Id uint `json:"operator_employe_id"`
|
||||
// Operator_Employe *eem.Employee `json:"operator_employe,omitempty" gorm:"foreignKey:Operator_Employe_Id;references:Id"`
|
||||
// Assistant_Employe_Id uint `json:"assistant_employe_id"`
|
||||
// Instrumentor_Employe_Id uint `json:"instrumentor_employe_id"`
|
||||
// Instrumentor_Employe *eem.Employee `json:"instrumentor_employe,omitempty" gorm:"foreignKey:Instrumentor_Employe_Id;references:Id"`
|
||||
// Nurse_Code string `json:"nurse_code" gorm:"size:10"`
|
||||
// Nurse *en.Nurse `json:"nurse,omitempty" gorm:"foreignKey:Nurse_Code;references:Code"`
|
||||
// Anesthesia_Doctor_Code string `json:"anesthesia_doctor_code" gorm:"size:10"`
|
||||
// Anesthesia *eem.Employee `json:"anesthesia,omitempty" gorm:"foreignKey:Anesthesia_Doctor_Code;references:Code"`
|
||||
// Anesthesia_Nurse_Employe_Id uint `json:"anesthesia_nurse_employe_id"`
|
||||
// Anesthesia_Nurse *eem.Employee `json:"anesthesia_nurse,omitempty" gorm:"foreignKey:Anesthesia_Nurse_Employe_Id;references:Id"`
|
||||
}
|
||||
@@ -10,7 +10,6 @@ type ProcedureRoom struct {
|
||||
Code string `json:"code" gorm:"unique;size:20"` // copied from infra code
|
||||
Infra_Code *string `json:"infra_code" gorm:"size:20;unique"`
|
||||
Type_Code *ero.ProdcedureRoomTypeCode `json:"type_code" gorm:"size:10"`
|
||||
Unit_Code *string `json:"unit_code" gorm:"size:20"`
|
||||
Specialist_Code *string `json:"specialist_code" gorm:"size:20"`
|
||||
Subspecialist_Code *string `json:"subspecialist_code" gorm:"size:20"`
|
||||
}
|
||||
|
||||
@@ -5,14 +5,12 @@ import (
|
||||
ei "simrs-vx/internal/domain/main-entities/infra"
|
||||
es "simrs-vx/internal/domain/main-entities/specialist"
|
||||
ess "simrs-vx/internal/domain/main-entities/subspecialist"
|
||||
eu "simrs-vx/internal/domain/main-entities/unit"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Code *string `json:"code"`
|
||||
Infra_Code *string `json:"infra_code"`
|
||||
Type_Code string `json:"type_code"`
|
||||
Unit_Code *string `json:"unit_code"`
|
||||
Specialist_Code *string `json:"specialist_code"`
|
||||
Subspecialist_Code *string `json:"subspecialist_code"`
|
||||
}
|
||||
@@ -26,7 +24,6 @@ type ReadListDto struct {
|
||||
type FilterDto struct {
|
||||
Infra_Code *string `json:"infra-code"`
|
||||
Type_Code string `json:"type-code"`
|
||||
Unit_Code *string `json:"unit-code"`
|
||||
Specialist_Code *string `json:"specialist-code"`
|
||||
Subspecialist_Code *string `json:"subspecialist-code"`
|
||||
}
|
||||
@@ -56,8 +53,6 @@ type ResponseDto struct {
|
||||
Type_Code *string `json:"type_code"`
|
||||
Infra_Code *string `json:"infra_code"`
|
||||
Infra *ei.Infra `json:"infra,omitempty"`
|
||||
Unit_Code *string `json:"unit_code"`
|
||||
Unit *eu.Unit `json:"unit,omitempty"`
|
||||
Specialist_Code *string `json:"specialist_code"`
|
||||
Specialist *es.Specialist `json:"specialist,omitempty"`
|
||||
Subspecialist_Code *string `json:"subspecialist_code"`
|
||||
@@ -70,8 +65,6 @@ func (d ProcedureRoom) ToResponse() ResponseDto {
|
||||
Infra_Code: d.Infra_Code,
|
||||
Infra: d.Infra,
|
||||
Type_Code: (*string)(d.Type_Code),
|
||||
Unit_Code: d.Unit_Code,
|
||||
Unit: d.Unit,
|
||||
Specialist_Code: d.Specialist_Code,
|
||||
Specialist: d.Specialist,
|
||||
Subspecialist_Code: d.Subspecialist_Code,
|
||||
|
||||
@@ -5,13 +5,11 @@ import (
|
||||
ebase "simrs-vx/internal/domain/main-entities/procedure-room/base"
|
||||
es "simrs-vx/internal/domain/main-entities/specialist"
|
||||
ess "simrs-vx/internal/domain/main-entities/subspecialist"
|
||||
eu "simrs-vx/internal/domain/main-entities/unit"
|
||||
)
|
||||
|
||||
type ProcedureRoom struct {
|
||||
ebase.ProcedureRoom
|
||||
Infra *ei.Infra `json:"infra,omitempty" gorm:"foreignKey:Infra_Code;references:Code"`
|
||||
Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Code;references:Code"`
|
||||
Specialist *es.Specialist `json:"specialist,omitempty" gorm:"foreignKey:Specialist_Code;references:Code"`
|
||||
Subspecialist *ess.Subspecialist `json:"subspecialist,omitempty" gorm:"foreignKey:Subspecialist_Code;references:Code"`
|
||||
}
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
package registrator
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ee "simrs-vx/internal/domain/main-entities/employee"
|
||||
ei "simrs-vx/internal/domain/main-entities/installation"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Employee_Id uint `json:"employee_id"`
|
||||
Installation_Code string `json:"installation_code" validate:"maxLength=20"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Employee_Id *uint `json:"employee-id"`
|
||||
Installation_Code *string `json:"installation-code"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
Id *uint `json:"id"`
|
||||
Employee_Id *uint `json:"employee_id"`
|
||||
Includes string `json:"includes"`
|
||||
}
|
||||
|
||||
type UpdateDto struct {
|
||||
Id *uint `json:"id"`
|
||||
CreateDto
|
||||
}
|
||||
|
||||
type DeleteDto struct {
|
||||
Id uint `json:"id"`
|
||||
}
|
||||
|
||||
type MetaDto struct {
|
||||
PageNumber int `json:"page_number"`
|
||||
PageSize int `json:"page_size"`
|
||||
Count int `json:"count"`
|
||||
}
|
||||
|
||||
type ResponseDto struct {
|
||||
ecore.Main
|
||||
Employee_Id uint `json:"employee_id"`
|
||||
Employee *ee.Employee `json:"employee,omitempty"`
|
||||
Installation_Code string `json:"installation_code"`
|
||||
Installation *ei.Installation `json:"installation,omitempty"`
|
||||
}
|
||||
|
||||
func (d Registrator) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Employee_Id: d.Employee_Id,
|
||||
Employee: d.Employee,
|
||||
Installation_Code: d.Installation_Code,
|
||||
Installation: d.Installation,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []Registrator) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package registrator
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ee "simrs-vx/internal/domain/main-entities/employee"
|
||||
ei "simrs-vx/internal/domain/main-entities/installation"
|
||||
)
|
||||
|
||||
type Registrator struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Employee_Id uint `json:"employee_id"`
|
||||
Employee *ee.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"`
|
||||
Installation_Code string `json:"installation_code" gorm:"size:20"`
|
||||
Installation *ei.Installation `json:"installation,omitempty" gorm:"foreignKey:Installation_Code;references:Code"`
|
||||
}
|
||||
@@ -4,14 +4,13 @@ import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
espb "simrs-vx/internal/domain/main-entities/specialist-position/base"
|
||||
essb "simrs-vx/internal/domain/main-entities/subspecialist/base"
|
||||
eu "simrs-vx/internal/domain/main-entities/unit"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Id *uint `json:"id"`
|
||||
Code string `json:"code" validate:"maxLength=10"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
Unit_Code *string `json:"unit_code"`
|
||||
Id *uint `json:"id"`
|
||||
Installation_Code string `json:"installation_code"`
|
||||
Code string `json:"code" validate:"maxLength=10"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
@@ -22,10 +21,9 @@ type ReadListDto struct {
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Unit_Code *string `json:"unit-code"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
@@ -54,8 +52,6 @@ type ResponseDto struct {
|
||||
ecore.SmallMain
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Unit_Code *string `json:"unit_code"`
|
||||
Unit *eu.Unit `json:"unit,omitempty"`
|
||||
SpecialistPositions []espb.Basic `json:"specialistPositions,omitempty"`
|
||||
Subspecialists []essb.Basic `json:"subspecialists,omitempty"`
|
||||
}
|
||||
@@ -64,8 +60,6 @@ func (d Specialist) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Code: d.Code,
|
||||
Name: d.Name,
|
||||
Unit: d.Unit,
|
||||
Unit_Code: d.Unit_Code,
|
||||
SpecialistPositions: d.SpecialistPositions,
|
||||
Subspecialists: d.Subspecialists,
|
||||
}
|
||||
|
||||
@@ -2,17 +2,17 @@ package specialist
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ei "simrs-vx/internal/domain/main-entities/installation"
|
||||
eub "simrs-vx/internal/domain/main-entities/specialist-position/base"
|
||||
essb "simrs-vx/internal/domain/main-entities/subspecialist/base"
|
||||
eu "simrs-vx/internal/domain/main-entities/unit"
|
||||
)
|
||||
|
||||
type Specialist struct {
|
||||
ecore.SmallMain // adjust this according to the needs
|
||||
Code string `json:"code" gorm:"unique;size:20"`
|
||||
Name string `json:"name" gorm:"size:50"`
|
||||
Unit_Code *string `json:"unit_code" gorm:"size:20"`
|
||||
Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Code;references:Code"`
|
||||
SpecialistPositions []eub.Basic `json:"specialistPositions,omitempty" gorm:"foreignKey:Specialist_Code;references:Code"`
|
||||
Subspecialists []essb.Basic `json:"subspecialists,omitempty" gorm:"foreignKey:Specialist_Code;references:Code"`
|
||||
ecore.SmallMain // adjust this according to the needs
|
||||
Code string `json:"code" gorm:"unique;size:20"`
|
||||
Name string `json:"name" gorm:"size:50"`
|
||||
Installation_Code string `json:"installation_code" gorm:"size:20"`
|
||||
Installation *ei.Installation `json:"installation,omitempty" gorm:"foreignKey:Installation_Code;references:Code"`
|
||||
SpecialistPositions []eub.Basic `json:"specialistPositions,omitempty" gorm:"foreignKey:Specialist_Code;references:Code"`
|
||||
Subspecialists []essb.Basic `json:"subspecialists,omitempty" gorm:"foreignKey:Specialist_Code;references:Code"`
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
type Basic struct {
|
||||
ecore.SmallMain // adjust this according to the needs
|
||||
Code string `json:"code" gorm:"unique;size:20"`
|
||||
Name string `json:"name" gorm:"size:50"`
|
||||
Name string `json:"name" gorm:"size:100"`
|
||||
Specialist_Code *string `json:"specialist_code" gorm:"size:20"`
|
||||
}
|
||||
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
package base
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ee "simrs-vx/internal/domain/main-entities/employee"
|
||||
)
|
||||
|
||||
type Basic struct {
|
||||
ecore.SmallMain // adjust this according to the needs
|
||||
Unit_Code *string `json:"unit_code" gorm:"size:10"`
|
||||
Code string `json:"code" gorm:"unique;size:10;not null"`
|
||||
Name string `json:"name" gorm:"size:30;not null"`
|
||||
HeadStatus bool `json:"headStatus"`
|
||||
Employee_Id *uint `json:"employee_id"`
|
||||
Employee *ee.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"`
|
||||
}
|
||||
|
||||
func (Basic) TableName() string {
|
||||
return "UnitPosition"
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
package unit_position
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ee "simrs-vx/internal/domain/main-entities/employee"
|
||||
eu "simrs-vx/internal/domain/main-entities/unit"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Unit_Code *string `json:"unit_code" validate:"required"`
|
||||
Code string `json:"code" validate:"maxLength=10;required"`
|
||||
Name string `json:"name" validate:"maxLength=30;required"`
|
||||
HeadStatus bool `json:"headStatus"`
|
||||
Employee_Id *uint `json:"employee_id"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Sort string `json:"sort"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Unit_Code *string `json:"unit-code"`
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
HeadStatus *bool `json:"head-status"`
|
||||
Employee_Id *uint `json:"employee-id"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
Id *uint16 `json:"id"`
|
||||
Code *string `json:"code"`
|
||||
}
|
||||
|
||||
type UpdateDto struct {
|
||||
Id *uint16 `json:"id"`
|
||||
CreateDto
|
||||
}
|
||||
|
||||
type DeleteDto struct {
|
||||
Id *uint16 `json:"id"`
|
||||
Code *string `json:"code"`
|
||||
}
|
||||
|
||||
type MetaDto struct {
|
||||
PageNumber int `json:"page_number"`
|
||||
PageSize int `json:"page_size"`
|
||||
Count int `json:"count"`
|
||||
}
|
||||
|
||||
type ResponseDto struct {
|
||||
ecore.SmallMain
|
||||
Unit_Code *string `json:"unit_code"`
|
||||
Unit *eu.Unit `json:"unit,omitempty"`
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
HeadStatus bool `json:"headStatus"`
|
||||
Employee_Id *uint `json:"employee_id"`
|
||||
Employee *ee.Employee `json:"employee,omitempty"`
|
||||
}
|
||||
|
||||
func (d UnitPosition) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Unit_Code: d.Unit_Code,
|
||||
Unit: d.Unit,
|
||||
Code: d.Code,
|
||||
Name: d.Name,
|
||||
HeadStatus: d.HeadStatus,
|
||||
Employee_Id: d.Employee_Id,
|
||||
Employee: d.Employee,
|
||||
}
|
||||
resp.SmallMain = d.SmallMain
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []UnitPosition) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
package unit_position
|
||||
|
||||
import (
|
||||
eu "simrs-vx/internal/domain/main-entities/unit"
|
||||
eub "simrs-vx/internal/domain/main-entities/unit-position/base"
|
||||
)
|
||||
|
||||
type UnitPosition struct {
|
||||
eub.Basic
|
||||
Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Code;references:Code"`
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
package unit
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ei "simrs-vx/internal/domain/main-entities/installation"
|
||||
eipb "simrs-vx/internal/domain/main-entities/unit-position/base"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Id *uint `json:"id"`
|
||||
Installation_Code *string `json:"installation_code"`
|
||||
Code string `json:"code" validate:"maxLength=20"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Sort string `json:"sort"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Installation_Code *string `json:"installation-code"`
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
Id *uint16 `json:"id"`
|
||||
Installation_Code *string `json:"installation_code"`
|
||||
Code *string `json:"code"`
|
||||
Includes string `json:"includes"`
|
||||
}
|
||||
|
||||
type UpdateDto struct {
|
||||
Id *uint16 `json:"id"`
|
||||
CreateDto
|
||||
}
|
||||
|
||||
type DeleteDto struct {
|
||||
Id *uint16 `json:"id"`
|
||||
Code *string `json:"code"`
|
||||
}
|
||||
|
||||
type MetaDto struct {
|
||||
PageNumber int `json:"page_number"`
|
||||
PageSize int `json:"page_size"`
|
||||
Count int `json:"count"`
|
||||
}
|
||||
|
||||
type ResponseDto struct {
|
||||
ecore.SmallMain
|
||||
Installation_Code *string `json:"installation_code"`
|
||||
Installation *ei.Installation `json:"installation,omitempty"`
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
UnitPositions []eipb.Basic `json:"unitPositions,omitempty"`
|
||||
}
|
||||
|
||||
func (d Unit) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Installation_Code: d.Installation_Code,
|
||||
Code: d.Code,
|
||||
Name: d.Name,
|
||||
UnitPositions: d.UnitPositions,
|
||||
}
|
||||
resp.SmallMain = d.SmallMain
|
||||
if d.Installation != nil {
|
||||
resp.Installation = d.Installation
|
||||
}
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []Unit) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package unit
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ei "simrs-vx/internal/domain/main-entities/installation"
|
||||
eub "simrs-vx/internal/domain/main-entities/unit-position/base"
|
||||
ero "simrs-vx/internal/domain/references/organization"
|
||||
)
|
||||
|
||||
type Unit struct {
|
||||
ecore.SmallMain // adjust this according to the needs
|
||||
Installation_Code *string `json:"installation_code" gorm:"size:20"`
|
||||
Installation *ei.Installation `json:"installation" gorm:"foreignKey:Installation_Code;references:Code"`
|
||||
Code string `json:"code" gorm:"unique;size:20"`
|
||||
Name string `json:"name" gorm:"size:50"`
|
||||
Type_Code *ero.UnitTypeCode `json:"type_code"`
|
||||
UnitPositions []eub.Basic `json:"unitPositions,omitempty" gorm:"foreignKey:Unit_Code;references:Code"`
|
||||
}
|
||||
@@ -13,22 +13,24 @@ import (
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Name string `json:"name" validate:"maxLength=25"`
|
||||
Password string `json:"password" validate:"maxLength=255"`
|
||||
Name string `json:"name" validate:"required;maxLength=50"`
|
||||
Password string `json:"password" validate:"required;maxLength=255"`
|
||||
ContractPosition_Code erg.ContractPositionCode `json:"contractPosition_code" gorm:"not null;size:20" validate:"required"`
|
||||
Status_Code erc.UserStatusCode `json:"status_code" validate:"maxLength=10"`
|
||||
Person_Id *uint `json:"-"`
|
||||
Person *ep.UpdateDto `json:"person"`
|
||||
PersonAddresses []epa.UpdateDto `json:"personAddresses"`
|
||||
PersonContacts []epc.UpdateDto `json:"personContacts"`
|
||||
Code *string `json:"code" validate:"maxLength=20"`
|
||||
Employee *EmployeUpdateDto `json:"employee"`
|
||||
IHS_Number *string `json:"ihs_number" validate:"maxLength=20"`
|
||||
SIP_Number *string `json:"sip_number" validate:"maxLength=20"`
|
||||
Unit_Code *string `json:"unit_code"`
|
||||
Infra_Code *string `json:"infra_code"`
|
||||
Specialist_Code *string `json:"specialist_code"`
|
||||
Subspecialist_Code *string `json:"subspecialist_code"`
|
||||
ContractPosition_Code erg.ContractPositionCode `json:"contractPosition_code" gorm:"not null;size:20"`
|
||||
|
||||
Employee *EmployeUpdateDto `json:"employee"`
|
||||
Person *ep.UpdateDto `json:"person"`
|
||||
PersonAddresses []epa.UpdateDto `json:"personAddresses"`
|
||||
PersonContacts []epc.UpdateDto `json:"personContacts"`
|
||||
Person_Id *uint `json:"-"`
|
||||
Code *string `json:"code" validate:"maxLength=20"`
|
||||
IHS_Number *string `json:"ihs_number" validate:"maxLength=20"`
|
||||
SIP_Number *string `json:"sip_number" validate:"maxLength=20"`
|
||||
Installation_Code *string `json:"installation_code"`
|
||||
Unit_Code *string `json:"unit_code"`
|
||||
Specialist_Code *string `json:"specialist_code"`
|
||||
Subspecialist_Code *string `json:"subspecialist_code"`
|
||||
Infra_Code *string `json:"infra_code"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
@@ -87,11 +89,20 @@ func (d *User) ToResponse() ResponseDto {
|
||||
type EmployeUpdateDto struct {
|
||||
Id uint `json:"id"`
|
||||
User_Id *uint `json:"-"`
|
||||
Person_Id *uint `json:"-"`
|
||||
Division_Code *string `json:"division_code"`
|
||||
Number *string `json:"number" validate:"maxLength=20"`
|
||||
Position_Code erg.EmployeePositionCode `json:"position_code" validate:"maxLength=20"`
|
||||
Status_Code erc.ActiveStatusCode `json:"status_code" validate:"maxLength=10"`
|
||||
Person_Id *uint `json:"-"`
|
||||
// TODO: Extras
|
||||
// Code *string `json:"code" validate:"maxLength=20"`
|
||||
// IHS_Number *string `json:"ihs_number" validate:"maxLength=20"`
|
||||
// SIP_Number *string `json:"sip_number" validate:"maxLength=20"`
|
||||
// Installation_Code *string `json:"installation_code"`
|
||||
// Unit_Code *string `json:"unit_code"`
|
||||
// Specialist_Code *string `json:"specialist_code"`
|
||||
// Subspecialist_Code *string `json:"subspecialist_code"`
|
||||
// Infra_Code *string `json:"infra_code"`
|
||||
}
|
||||
|
||||
func ToResponseList(data []User) []ResponseDto {
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
type User struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Name string `json:"name" gorm:"unique;not null;size:25"`
|
||||
Name string `json:"name" gorm:"unique;not null;size:50"`
|
||||
Password string `json:"password" gorm:"not null;size:255"`
|
||||
Status_Code erc.UserStatusCode `json:"status_code" gorm:"not null;size:10"`
|
||||
ContractPosition_Code erg.ContractPositionCode `json:"contractPosition_code" gorm:"not null;size:20"`
|
||||
|
||||
@@ -31,6 +31,7 @@ type (
|
||||
BornMortalityCode string
|
||||
BornLocationCode string
|
||||
SpecimentDestCode string
|
||||
ProcedureReportType string
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -208,37 +209,40 @@ const (
|
||||
MSCMicroLab McuScopeCode = "micro-lab"
|
||||
MSCApLab McuScopeCode = "ap-lab"
|
||||
|
||||
SSCSmall SurgerySizeCode = ""
|
||||
SSCMedium SurgerySizeCode = ""
|
||||
SSCLarge SurgerySizeCode = ""
|
||||
SSCSpecial SurgerySizeCode = ""
|
||||
SSCSmall SurgerySizeCode = "small"
|
||||
SSCMedium SurgerySizeCode = "medium"
|
||||
SSCLarge SurgerySizeCode = "large"
|
||||
SSCSpecial SurgerySizeCode = "special"
|
||||
|
||||
SSyCCito SurgerySystemCode = ""
|
||||
SSyCUrgent SurgerySystemCode = ""
|
||||
SSyCEfective SurgerySystemCode = ""
|
||||
SSyCSpecial SurgerySystemCode = ""
|
||||
SSyCCito SurgerySystemCode = "cito"
|
||||
SSyCUrgent SurgerySystemCode = "urgent"
|
||||
SSyCEfective SurgerySystemCode = "efective"
|
||||
SSyCSpecial SurgerySystemCode = "special"
|
||||
|
||||
STCClean SurgeryTypeCode = ""
|
||||
STCCleanCtm SurgeryTypeCode = ""
|
||||
STCUncleanCtm SurgeryTypeCode = ""
|
||||
STCUnclean SurgeryTypeCode = ""
|
||||
STCClean SurgeryTypeCode = "clean"
|
||||
STCCleanCtm SurgeryTypeCode = "clean-ctm"
|
||||
STCUncleanCtm SurgeryTypeCode = "unclean-ctm"
|
||||
STCUnclean SurgeryTypeCode = "unclean"
|
||||
|
||||
SStCFirst SurgeryStageCode = ""
|
||||
SStCRepeat SurgeryStageCode = ""
|
||||
SStCFirst SurgeryStageCode = "first"
|
||||
SStCRepeat SurgeryStageCode = "repeat"
|
||||
|
||||
BMCAlive BornMortalityCode = ""
|
||||
BMCDead BornMortalityCode = ""
|
||||
BMCAlive BornMortalityCode = "alive"
|
||||
BMCDead BornMortalityCode = "dead"
|
||||
|
||||
BLCExtMiw BornLocationCode = ""
|
||||
BLCExtDoc BornLocationCode = ""
|
||||
BLCTradMiw BornLocationCode = ""
|
||||
BLCLocalMed BornLocationCode = ""
|
||||
BLCExtParamedic BornLocationCode = ""
|
||||
BLCExtMiw BornLocationCode = "ext-miw"
|
||||
BLCExtDoc BornLocationCode = "ext-doc"
|
||||
BLCTradMiw BornLocationCode = "trad-miw"
|
||||
BLCLocalMed BornLocationCode = "local-med"
|
||||
BLCExtParamedic BornLocationCode = "ext-paramedic"
|
||||
|
||||
SDCAp SpecimentDestCode = ""
|
||||
SDCMicro SpecimentDestCode = ""
|
||||
SDCLab SpecimentDestCode = ""
|
||||
SDCNone SpecimentDestCode = ""
|
||||
SDCAp SpecimentDestCode = "ap"
|
||||
SDCMicro SpecimentDestCode = "micro"
|
||||
SDCLab SpecimentDestCode = "lab"
|
||||
SDCNone SpecimentDestCode = "none"
|
||||
|
||||
PRTProcedure ProcedureReportType = "procedure"
|
||||
PRTSurgery ProcedureReportType = "surgery"
|
||||
)
|
||||
|
||||
type Soapi struct {
|
||||
@@ -364,8 +368,11 @@ type HeadToToe struct {
|
||||
BodyOthers string `json:"body-others,omitempty"`
|
||||
}
|
||||
|
||||
type RecordAction struct {
|
||||
Procedures []string `json:"procedures"`
|
||||
type ProcedureRecord struct {
|
||||
Procedures []CodeWithName `json:"procedures"`
|
||||
}
|
||||
|
||||
type ProcedureExecution struct {
|
||||
SurgerySize_Code *string `json:"surgerySize_code"`
|
||||
Billing_Code *string `json:"billing_code"`
|
||||
SurgerySystem_Code *string `json:"surgerySystem_code"`
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package m_dokter
|
||||
|
||||
import "time"
|
||||
|
||||
type MDokter struct {
|
||||
Kddokter uint `gorm:"column:kddokter;primaryKey;autoIncrement" json:"kddokter"`
|
||||
Kdpoly uint `gorm:"column:kdpoly" json:"kdpoly"`
|
||||
Namadokter string `gorm:"column:namadokter" json:"namadokter"`
|
||||
Kdprofesi *uint `gorm:"column:kdprofesi" json:"kdprofesi"`
|
||||
Namaprofesi *string `gorm:"column:namaprofesi" json:"namaprofesi"`
|
||||
Aktif uint16 `gorm:"column:aktif" json:"aktif"`
|
||||
KdSMF *string `gorm:"column:kdsmf" json:"kdsmf"`
|
||||
KodeDPJP *string `gorm:"column:kode_dpjp" json:"kode_dpjp"`
|
||||
NIP *string `gorm:"column:nip" json:"nip"`
|
||||
Kategori *string `gorm:"column:kategori" json:"kategori"`
|
||||
TglAkhirSIP *time.Time `gorm:"column:tgl_akhir_sip" json:"tgl_akhir_sip"`
|
||||
NoHP *string `gorm:"column:no_hp" json:"no_hp"`
|
||||
Email *string `gorm:"column:email" json:"email"`
|
||||
TglAkhirSPK *time.Time `gorm:"column:tgl_akhir_spk" json:"tgl_akhir_spk"`
|
||||
}
|
||||
|
||||
func (MDokter) TableName() string {
|
||||
return "m_dokter"
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package m_login
|
||||
|
||||
type MLogin struct {
|
||||
NIP string `gorm:"column:nip;primaryKey"`
|
||||
Password string `gorm:"column:pwd"`
|
||||
SesReg string `gorm:"column:ses_reg"`
|
||||
KdPerawat uint `gorm:"column:kdperawat"`
|
||||
KdDokter uint `gorm:"column:kddokter"`
|
||||
NamaPegawai string `gorm:"column:nama_pegawai"`
|
||||
Roles int `gorm:"column:roles"`
|
||||
KdUnit uint `gorm:"column:kdunit"`
|
||||
Departemen string `gorm:"column:departemen"`
|
||||
StDokterRajalEksekutif *uint16 `gorm:"column:st_dokter_rajal_eksekutif"`
|
||||
StDokterRajalReguler *uint16 `gorm:"column:st_dokter_rajal_reguler"`
|
||||
StDokterRajalEmergency *uint16 `gorm:"column:st_dokter_rajal_emergency"`
|
||||
NIPB *string `gorm:"column:nipb"`
|
||||
Aktif uint16 `gorm:"column:aktif"`
|
||||
}
|
||||
|
||||
func (MLogin) TableName() string {
|
||||
return "m_login"
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package m_pegawai
|
||||
|
||||
import "time"
|
||||
|
||||
type MPegawai struct {
|
||||
NoPeg uint `gorm:"column:no_peg;primaryKey"`
|
||||
NamaPeg string `gorm:"column:nama_peg"`
|
||||
NIPB string `gorm:"column:nipb"`
|
||||
Gol string `gorm:"column:gol"`
|
||||
SatuanKerja string `gorm:"column:satuan_kerja"`
|
||||
Ruang string `gorm:"column:ruang"`
|
||||
Pendidikan string `gorm:"column:pendidikan"`
|
||||
Tenaga string `gorm:"column:tenaga"`
|
||||
Tenaga1 string `gorm:"column:tenaga1"`
|
||||
Tenaga2 string `gorm:"column:tenaga2"`
|
||||
TMTMasuk *time.Time `gorm:"column:tmt_masuk"`
|
||||
TempatLahir string `gorm:"column:tmp_lahir"`
|
||||
TanggalLahir *time.Time `gorm:"column:tgl_lahir"`
|
||||
Alamat string `gorm:"column:alamat"`
|
||||
Telepon string `gorm:"column:telepon"`
|
||||
HP string `gorm:"column:hp"`
|
||||
Karpeg string `gorm:"column:karpeg"`
|
||||
Kelamin string `gorm:"column:kelamin"`
|
||||
Agama string `gorm:"column:agama"`
|
||||
StatusTubel uint16 `gorm:"column:status_tubel"` // smallint → bool
|
||||
NIK string `gorm:"column:nik"`
|
||||
Seksi string `gorm:"column:seksi"`
|
||||
TMTAwalSIP *time.Time `gorm:"column:tmt_awal_sip"`
|
||||
TMTAkhirSIPStr *time.Time `gorm:"column:tmt_akhir_sip_str"`
|
||||
NoSIP string `gorm:"column:no_sip"`
|
||||
NoSTR string `gorm:"column:no_str"`
|
||||
LoginID string `gorm:"column:login_id"`
|
||||
CodeKasir string `gorm:"column:code_kasir"`
|
||||
}
|
||||
|
||||
func (MPegawai) TableName() string {
|
||||
return "m_pegawai"
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package m_perawat
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type MPerawat struct {
|
||||
Idperawat *uint `json:"idperawat" gorm:"column:idperawat;primaryKey"`
|
||||
NIP string `json:"nip" gorm:"column:nip"`
|
||||
UnitKerja *uint `json:"unit_kerja" gorm:"column:unit_kerja"`
|
||||
Ruang *string `json:"ruang" gorm:"column:ruang"`
|
||||
Nama string `json:"nama" gorm:"column:nama"`
|
||||
Tempat *string `json:"tempat" gorm:"column:tempat"`
|
||||
TglLahir *time.Time `json:"tgllahir" gorm:"column:tgllahir"`
|
||||
JenisKelamin *string `json:"jeniskelamin" gorm:"column:jeniskelamin"`
|
||||
Alamat *string `json:"alamat" gorm:"column:alamat"`
|
||||
Kelurahan *string `json:"kelurahan" gorm:"column:kelurahan"`
|
||||
Kdkecamatan *uint `json:"kdkecamatan" gorm:"column:kdkecamatan"`
|
||||
Kota *string `json:"kota" gorm:"column:kota"`
|
||||
KdProvinsi *uint `json:"kdprovinsi" gorm:"column:kdprovinsi"`
|
||||
NoTelp *string `json:"notelp" gorm:"column:notelp"`
|
||||
NoKTP *string `json:"noktp" gorm:"column:noktp"`
|
||||
Status *uint `json:"status" gorm:"column:status"`
|
||||
Agama *uint `json:"agama" gorm:"column:agama"`
|
||||
Pendidikan *uint `json:"pendidikan" gorm:"column:pendidikan"`
|
||||
AlamatKTP *string `json:"alamat_ktp" gorm:"column:alamat_ktp"`
|
||||
JabFung *string `json:"jabfung" gorm:"column:jabfung"`
|
||||
JabStruk *string `json:"jabstruk" gorm:"column:jabstruk"`
|
||||
LamKer *string `json:"lamker" gorm:"column:lamker"`
|
||||
TemKer *string `json:"temker" gorm:"column:temker"`
|
||||
TemKer2 *string `json:"temker2" gorm:"column:temker2"`
|
||||
PelManKep *string `json:"pelmankep" gorm:"column:pelmankep"`
|
||||
PelTekKepGaw *string `json:"peltekkepgaw" gorm:"column:peltekkepgaw"`
|
||||
PelTekKepMedah *string `json:"peltekkepmedah" gorm:"column:peltekkepmedah"`
|
||||
PelTekKepNak *string `json:"peltekkepnak" gorm:"column:peltekkepnak"`
|
||||
PelTekKepMat *string `json:"peltekkepmat" gorm:"column:peltekkepmat"`
|
||||
PelTekKepJiwa *string `json:"peltekkepjiwa" gorm:"column:peltekkepjiwa"`
|
||||
TemKerTuj *string `json:"temkertuj" gorm:"column:temkertuj"`
|
||||
TemKerTuj2 *string `json:"temkertuj2" gorm:"column:temkertuj2"`
|
||||
TglMutasi *time.Time `json:"tglmutasi" gorm:"column:tglmutasi"`
|
||||
Alasan *string `json:"alasan" gorm:"column:alasan"`
|
||||
TglKeluar *time.Time `json:"tglkeluar" gorm:"column:tglkeluar"`
|
||||
ProgPendidikan *uint `json:"progpendidikan" gorm:"column:progpendidikan"`
|
||||
ProgPeng *string `json:"progpeng" gorm:"column:progpeng"`
|
||||
JabLain *string `json:"jablain" gorm:"column:jablain"`
|
||||
PPA uint `json:"ppa" gorm:"column:ppa"`
|
||||
Aktif uint `json:"aktif" gorm:"column:aktif"`
|
||||
}
|
||||
|
||||
func (MPerawat) TableName() string {
|
||||
return "m_perawat"
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package doctor
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
erc "simrs-vx/internal/domain/references/common"
|
||||
"time"
|
||||
)
|
||||
|
||||
type DoctorLink struct {
|
||||
ecore.Main
|
||||
Simx_Id uint `json:"simx_id" gorm:"unique"`
|
||||
Simgos_Id uint `json:"simgos_id" gorm:"unique"`
|
||||
}
|
||||
|
||||
type DoctorSimxLog struct {
|
||||
ecore.Main
|
||||
Value *string `json:"value"`
|
||||
Date *time.Time `json:"date"`
|
||||
Status erc.ProcessStatusCode `json:"status"`
|
||||
ErrMessage *string `json:"errMessage"`
|
||||
}
|
||||
|
||||
type DoctorSimgosLog struct {
|
||||
ecore.Main
|
||||
Value *string `json:"value"`
|
||||
Date *time.Time `json:"date"`
|
||||
Status erc.ProcessStatusCode `json:"status"`
|
||||
ErrMessage *string `json:"errMessage"`
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package nurse
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
erc "simrs-vx/internal/domain/references/common"
|
||||
"time"
|
||||
)
|
||||
|
||||
type NurseLink struct {
|
||||
ecore.Main
|
||||
Simx_Id uint `json:"simx_id" gorm:"unique"`
|
||||
Simgos_Id uint `json:"simgos_id" gorm:"unique"`
|
||||
}
|
||||
|
||||
type NurseSimxLog struct {
|
||||
ecore.Main
|
||||
Value *string `json:"value"`
|
||||
Date *time.Time `json:"date"`
|
||||
Status erc.ProcessStatusCode `json:"status"`
|
||||
ErrMessage *string `json:"errMessage"`
|
||||
}
|
||||
|
||||
type NurseSimgosLog struct {
|
||||
ecore.Main
|
||||
Value *string `json:"value"`
|
||||
Date *time.Time `json:"date"`
|
||||
Status erc.ProcessStatusCode `json:"status"`
|
||||
ErrMessage *string `json:"errMessage"`
|
||||
}
|
||||
@@ -240,8 +240,8 @@ func (obj myBase) Skip(w http.ResponseWriter, r *http.Request) {
|
||||
rw.DataResponse(w, res, err)
|
||||
}
|
||||
|
||||
func (obj myBase) RequestSwitchUnit(w http.ResponseWriter, r *http.Request) {
|
||||
dto := e.SwitchUnitDto{}
|
||||
func (obj myBase) RequestSwitchSpecialist(w http.ResponseWriter, r *http.Request) {
|
||||
dto := e.SwitchSpecialistDto{}
|
||||
id := rw.ValidateInt(w, "id", r.PathValue("id"))
|
||||
if id <= 0 {
|
||||
return
|
||||
@@ -252,7 +252,7 @@ func (obj myBase) RequestSwitchUnit(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
// validate request body
|
||||
if valid := validateRequestSwitchUnit(w, dto); !valid {
|
||||
if valid := validateRequestSwitchSpecialist(w, dto); !valid {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -263,12 +263,12 @@ func (obj myBase) RequestSwitchUnit(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
dto.AuthInfo = *authInfo
|
||||
dto.Id = uint(id)
|
||||
res, err := u.RequestSwitchUnit(dto)
|
||||
res, err := u.RequestSwitchSpecialist(dto)
|
||||
rw.DataResponse(w, res, err)
|
||||
}
|
||||
|
||||
func (obj myBase) ApproveSwitchUnit(w http.ResponseWriter, r *http.Request) {
|
||||
dto := e.ApproveCancelUnitDto{}
|
||||
func (obj myBase) ApproveSwitchSpecialist(w http.ResponseWriter, r *http.Request) {
|
||||
dto := e.ApproveCancelSpecialistDto{}
|
||||
id := rw.ValidateInt(w, "id", r.PathValue("id"))
|
||||
if id <= 0 {
|
||||
return
|
||||
@@ -286,12 +286,12 @@ func (obj myBase) ApproveSwitchUnit(w http.ResponseWriter, r *http.Request) {
|
||||
dto.AuthInfo = *authInfo
|
||||
dto.Id = uint(id)
|
||||
|
||||
res, err := u.ApproveSwitchUnit(dto)
|
||||
res, err := u.ApproveSwitchSpecialist(dto)
|
||||
rw.DataResponse(w, res, err)
|
||||
}
|
||||
|
||||
func (obj myBase) CancelSwitchUnit(w http.ResponseWriter, r *http.Request) {
|
||||
dto := e.ApproveCancelUnitDto{}
|
||||
func (obj myBase) CancelSwitchSpecialist(w http.ResponseWriter, r *http.Request) {
|
||||
dto := e.ApproveCancelSpecialistDto{}
|
||||
id := rw.ValidateInt(w, "id", r.PathValue("id"))
|
||||
if id <= 0 {
|
||||
return
|
||||
@@ -309,6 +309,32 @@ func (obj myBase) CancelSwitchUnit(w http.ResponseWriter, r *http.Request) {
|
||||
dto.AuthInfo = *authInfo
|
||||
dto.Id = uint(id)
|
||||
|
||||
res, err := u.CancelSwitchUnit(dto)
|
||||
res, err := u.CancelSwitchSpecialist(dto)
|
||||
rw.DataResponse(w, res, err)
|
||||
}
|
||||
|
||||
func (obj myBase) CreateWithPatient(w http.ResponseWriter, r *http.Request) {
|
||||
authInfo, err := pa.GetAuthInfo(r)
|
||||
if err != nil {
|
||||
rw.WriteJSON(w, http.StatusUnauthorized, d.IS{"message": err.Error()}, nil)
|
||||
}
|
||||
|
||||
dto := e.CreateWithPatientDto{}
|
||||
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
|
||||
return
|
||||
}
|
||||
|
||||
// validate SubClass
|
||||
if err := verifyClassCode(dto.Encounter); err != nil {
|
||||
rw.DataResponse(w, nil, d.FieldError{
|
||||
Code: dataValidationFail,
|
||||
Message: err.Error(),
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
dto.Encounter.AuthInfo = *authInfo
|
||||
dto.Patient.AuthInfo = *authInfo
|
||||
res, err := u.CreateWithPatient(dto)
|
||||
rw.DataResponse(w, res, err)
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ func validateRequestCheckIn(w http.ResponseWriter, i e.CheckinDto) (valid bool)
|
||||
return true
|
||||
}
|
||||
|
||||
func validateRequestSwitchUnit(w http.ResponseWriter, i e.SwitchUnitDto) (valid bool) {
|
||||
func validateRequestSwitchSpecialist(w http.ResponseWriter, i e.SwitchSpecialistDto) (valid bool) {
|
||||
// validate poly-switch-code
|
||||
if i.PolySwitchCode == nil {
|
||||
rw.DataResponse(w, nil, d.FieldError{
|
||||
@@ -84,7 +84,7 @@ func validateRequestSwitchUnit(w http.ResponseWriter, i e.SwitchUnitDto) (valid
|
||||
}
|
||||
|
||||
for _, v := range *i.InternalReferences {
|
||||
if v.Unit_Code == nil {
|
||||
if v.Specialist_Code == nil {
|
||||
rw.DataResponse(w, nil, d.FieldError{
|
||||
Code: dataValidationFail,
|
||||
Message: "internalReferences.unit_code required",
|
||||
|
||||
@@ -4,7 +4,6 @@ import (
|
||||
"net/http"
|
||||
|
||||
/******************** main / transaction ********************/
|
||||
actionreport "simrs-vx/internal/interface/main-handler/action-report"
|
||||
adime "simrs-vx/internal/interface/main-handler/adime"
|
||||
admemployeehist "simrs-vx/internal/interface/main-handler/adm-employee-hist"
|
||||
ambulancetransportrequest "simrs-vx/internal/interface/main-handler/ambulance-transport-req"
|
||||
@@ -33,6 +32,7 @@ import (
|
||||
practiceschedule "simrs-vx/internal/interface/main-handler/practice-schedule"
|
||||
prescription "simrs-vx/internal/interface/main-handler/prescription"
|
||||
prescriptionitem "simrs-vx/internal/interface/main-handler/prescription-item"
|
||||
procedurereport "simrs-vx/internal/interface/main-handler/procedure-report"
|
||||
procedureroom "simrs-vx/internal/interface/main-handler/procedure-room"
|
||||
procedureroomorder "simrs-vx/internal/interface/main-handler/procedure-room-order"
|
||||
procedureroomorderitem "simrs-vx/internal/interface/main-handler/procedure-room-order-item"
|
||||
@@ -115,8 +115,6 @@ import (
|
||||
subspecialist "simrs-vx/internal/interface/main-handler/subspecialist"
|
||||
subspecialistposition "simrs-vx/internal/interface/main-handler/subspecialist-position"
|
||||
therapyprotocol "simrs-vx/internal/interface/main-handler/therapy-protocol"
|
||||
unit "simrs-vx/internal/interface/main-handler/unit"
|
||||
unitposition "simrs-vx/internal/interface/main-handler/unit-position"
|
||||
uom "simrs-vx/internal/interface/main-handler/uom"
|
||||
vehicle "simrs-vx/internal/interface/main-handler/vehicle"
|
||||
vehiclehist "simrs-vx/internal/interface/main-handler/vehicle-hist"
|
||||
@@ -138,6 +136,7 @@ import (
|
||||
reference "simrs-vx/internal/interface/main-handler/reference"
|
||||
referral "simrs-vx/internal/interface/main-handler/referral"
|
||||
vclaimsep "simrs-vx/internal/interface/main-handler/vclaim-sep"
|
||||
vclaimsepcontrolletter "simrs-vx/internal/interface/main-handler/vclaim-sep-control-letter"
|
||||
vclaimsephist "simrs-vx/internal/interface/main-handler/vclaim-sep-hist"
|
||||
vclaimsepprint "simrs-vx/internal/interface/main-handler/vclaim-sep-print"
|
||||
)
|
||||
@@ -178,7 +177,7 @@ func SetRoutes() http.Handler {
|
||||
hc.RegCrud(r, "/v1/sbar", auth.GuardMW, sbar.O)
|
||||
hc.RegCrud(r, "/v1/prescription-item", prescriptionitem.O)
|
||||
hc.RegCrud(r, "/v1/device-order-item", deviceorderitem.O)
|
||||
hc.RegCrud(r, "/v1/action-report", auth.GuardMW, actionreport.O)
|
||||
hc.RegCrud(r, "/v1/procedure-report", auth.GuardMW, procedurereport.O)
|
||||
|
||||
hc.RegCrud(r, "/v1/material-order-item", materialorderitem.O)
|
||||
hk.GroupRoutes("/v1/encounter", r, auth.GuardMW, hk.MapHandlerFunc{
|
||||
@@ -193,9 +192,10 @@ func SetRoutes() http.Handler {
|
||||
"PATCH /{id}/cancel": encounter.O.Cancel,
|
||||
"PATCH /{id}/reject": encounter.O.Reject,
|
||||
"PATCH /{id}/skip": encounter.O.Skip,
|
||||
"PATCH /{id}/req-switch-unit": encounter.O.RequestSwitchUnit,
|
||||
"PATCH /{id}/approve-switch-unit": encounter.O.ApproveSwitchUnit,
|
||||
"PATCH /{id}/cancel-switch-unit": encounter.O.CancelSwitchUnit,
|
||||
"PATCH /{id}/req-switch-unit": encounter.O.RequestSwitchSpecialist,
|
||||
"PATCH /{id}/approve-switch-unit": encounter.O.ApproveSwitchSpecialist,
|
||||
"PATCH /{id}/cancel-switch-unit": encounter.O.CancelSwitchSpecialist,
|
||||
"POST /create-with-patient": encounter.O.CreateWithPatient,
|
||||
})
|
||||
hk.GroupRoutes("/v1/mcu-order", r, auth.GuardMW, hk.MapHandlerFunc{
|
||||
"GET /": mcuorder.O.GetList,
|
||||
@@ -375,9 +375,7 @@ func SetRoutes() http.Handler {
|
||||
hc.RegCrudByCode(r, "/v1/division", division.O)
|
||||
hc.RegCrudByCode(r, "/v1/division-position", divisionposition.O)
|
||||
hc.RegCrudByCode(r, "/v1/installation", installation.O)
|
||||
hc.RegCrudByCode(r, "/v1/unit", unit.O)
|
||||
hc.RegCrudByCode(r, "/v1/installation-position", installationposition.O)
|
||||
hc.RegCrudByCode(r, "/v1/unit-position", unitposition.O)
|
||||
hc.RegCrudByCode(r, "/v1/specialist", specialist.O)
|
||||
hc.RegCrudByCode(r, "/v1/subspecialist", subspecialist.O)
|
||||
hc.RegCrudByCode(r, "/v1/specialist-position", specialistposition.O)
|
||||
@@ -422,6 +420,10 @@ func SetRoutes() http.Handler {
|
||||
"DELETE /{number}": vclaimsep.O.Delete,
|
||||
})
|
||||
|
||||
hk.GroupRoutes("/v1/vclaim-sep-control-letter", r, hk.MapHandlerFunc{
|
||||
"POST /": vclaimsepcontrolletter.O.Create,
|
||||
})
|
||||
|
||||
hk.GroupRoutes("/v1/vclaim-sep-hist", r, hk.MapHandlerFunc{
|
||||
"GET /": vclaimsephist.O.GetList,
|
||||
})
|
||||
|
||||
@@ -59,19 +59,18 @@ func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
dto := e.UpdateDto{}
|
||||
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
|
||||
return
|
||||
}
|
||||
|
||||
authInfo, err := pa.GetAuthInfo(r)
|
||||
if err != nil {
|
||||
rw.WriteJSON(w, http.StatusUnauthorized, d.IS{"message": err.Error()}, nil)
|
||||
}
|
||||
|
||||
dto := e.UpdateDto{}
|
||||
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
|
||||
return
|
||||
}
|
||||
|
||||
dto.Id = uint(id)
|
||||
dto.AuthInfo = *authInfo
|
||||
|
||||
res, err := u.Update(dto)
|
||||
rw.DataResponse(w, res, err)
|
||||
}
|
||||
|
||||
+2
-2
@@ -8,8 +8,8 @@ import (
|
||||
|
||||
// ua "github.com/karincake/tumpeng/auth/svc"
|
||||
|
||||
e "simrs-vx/internal/domain/main-entities/action-report"
|
||||
u "simrs-vx/internal/use-case/main-use-case/action-report"
|
||||
e "simrs-vx/internal/domain/main-entities/procedure-report"
|
||||
u "simrs-vx/internal/use-case/main-use-case/procedure-report"
|
||||
|
||||
pa "simrs-vx/internal/lib/auth"
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
package unit_position
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
rw "github.com/karincake/risoles"
|
||||
sf "github.com/karincake/semprit"
|
||||
|
||||
// ua "github.com/karincake/tumpeng/auth/svc"
|
||||
|
||||
e "simrs-vx/internal/domain/main-entities/unit-position"
|
||||
u "simrs-vx/internal/use-case/main-use-case/unit-position"
|
||||
)
|
||||
|
||||
type myBase struct{}
|
||||
|
||||
var O myBase
|
||||
|
||||
func (obj myBase) Create(w http.ResponseWriter, r *http.Request) {
|
||||
dto := e.CreateDto{}
|
||||
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
|
||||
return
|
||||
}
|
||||
res, err := u.Create(dto)
|
||||
rw.DataResponse(w, res, err)
|
||||
}
|
||||
|
||||
func (obj myBase) GetList(w http.ResponseWriter, r *http.Request) {
|
||||
dto := e.ReadListDto{}
|
||||
sf.UrlQueryParam(&dto, *r.URL)
|
||||
res, err := u.ReadList(dto)
|
||||
rw.DataResponse(w, res, err)
|
||||
}
|
||||
|
||||
func (obj myBase) GetDetail(w http.ResponseWriter, r *http.Request) {
|
||||
code := rw.ValidateString(w, "code", r.PathValue("code"))
|
||||
if code == "" {
|
||||
return
|
||||
}
|
||||
dto := e.ReadDetailDto{}
|
||||
dto.Code = &code
|
||||
res, err := u.ReadDetail(dto)
|
||||
rw.DataResponse(w, res, err)
|
||||
}
|
||||
|
||||
func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
|
||||
code := rw.ValidateString(w, "code", r.PathValue("code"))
|
||||
if code == "" {
|
||||
return
|
||||
}
|
||||
|
||||
dto := e.UpdateDto{}
|
||||
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
|
||||
return
|
||||
}
|
||||
dto.Code = code
|
||||
res, err := u.Update(dto)
|
||||
rw.DataResponse(w, res, err)
|
||||
}
|
||||
|
||||
func (obj myBase) Delete(w http.ResponseWriter, r *http.Request) {
|
||||
code := rw.ValidateString(w, "code", r.PathValue("code"))
|
||||
if code == "" {
|
||||
return
|
||||
}
|
||||
|
||||
dto := e.DeleteDto{}
|
||||
dto.Code = &code
|
||||
res, err := u.Delete(dto)
|
||||
rw.DataResponse(w, res, err)
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
package unit
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
rw "github.com/karincake/risoles"
|
||||
sf "github.com/karincake/semprit"
|
||||
|
||||
// ua "github.com/karincake/tumpeng/auth/svc"
|
||||
|
||||
e "simrs-vx/internal/domain/main-entities/unit"
|
||||
u "simrs-vx/internal/use-case/main-use-case/unit"
|
||||
)
|
||||
|
||||
type myBase struct{}
|
||||
|
||||
var O myBase
|
||||
|
||||
func (obj myBase) Create(w http.ResponseWriter, r *http.Request) {
|
||||
dto := e.CreateDto{}
|
||||
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
|
||||
return
|
||||
}
|
||||
res, err := u.Create(dto)
|
||||
rw.DataResponse(w, res, err)
|
||||
}
|
||||
|
||||
func (obj myBase) GetList(w http.ResponseWriter, r *http.Request) {
|
||||
dto := e.ReadListDto{}
|
||||
sf.UrlQueryParam(&dto, *r.URL)
|
||||
res, err := u.ReadList(dto)
|
||||
rw.DataResponse(w, res, err)
|
||||
}
|
||||
|
||||
func (obj myBase) GetDetail(w http.ResponseWriter, r *http.Request) {
|
||||
code := rw.ValidateString(w, "code", r.PathValue("code"))
|
||||
if code == "" {
|
||||
return
|
||||
}
|
||||
dto := e.ReadDetailDto{}
|
||||
|
||||
sf.UrlQueryParam(&dto, *r.URL)
|
||||
dto.Code = &code
|
||||
res, err := u.ReadDetail(dto)
|
||||
rw.DataResponse(w, res, err)
|
||||
}
|
||||
|
||||
func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
|
||||
code := rw.ValidateString(w, "code", r.PathValue("code"))
|
||||
if code == "" {
|
||||
return
|
||||
}
|
||||
|
||||
dto := e.UpdateDto{}
|
||||
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
|
||||
return
|
||||
}
|
||||
dto.Code = code
|
||||
res, err := u.Update(dto)
|
||||
rw.DataResponse(w, res, err)
|
||||
}
|
||||
|
||||
func (obj myBase) Delete(w http.ResponseWriter, r *http.Request) {
|
||||
code := rw.ValidateString(w, "code", r.PathValue("code"))
|
||||
if code == "" {
|
||||
return
|
||||
}
|
||||
|
||||
dto := e.DeleteDto{}
|
||||
dto.Code = &code
|
||||
res, err := u.Delete(dto)
|
||||
rw.DataResponse(w, res, err)
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package vclaimsepcontrolletter
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
rw "github.com/karincake/risoles"
|
||||
|
||||
e "simrs-vx/internal/domain/bpjs-entities/vclaim-sep-control-letter"
|
||||
u "simrs-vx/internal/use-case/bpjs-use-case/vclaim-sep-control-letter"
|
||||
)
|
||||
|
||||
type myBase struct{}
|
||||
|
||||
var O myBase
|
||||
|
||||
func (obj myBase) Create(w http.ResponseWriter, r *http.Request) {
|
||||
dto := e.CreateDto{}
|
||||
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
|
||||
return
|
||||
}
|
||||
res, err := u.Create(dto)
|
||||
rw.DataResponse(w, res, err)
|
||||
}
|
||||
|
||||
// func (obj myBase) GetList(w http.ResponseWriter, r *http.Request) {
|
||||
// dto := e.ReadListDto{}
|
||||
// sf.UrlQueryParam(&dto, *r.URL)
|
||||
// res, err := u.ReadList(dto)
|
||||
// rw.DataResponse(w, res, err)
|
||||
// }
|
||||
|
||||
// func (obj myBase) GetDetail(w http.ResponseWriter, r *http.Request) {
|
||||
// number := rw.ValidateString(w, "number", r.PathValue("number"))
|
||||
// if number <= "" {
|
||||
// return
|
||||
// }
|
||||
// dto := e.ReadDetailDto{}
|
||||
// dto.Number = &number
|
||||
// res, err := u.ReadDetail(dto)
|
||||
// rw.DataResponse(w, res, err)
|
||||
// }
|
||||
|
||||
// func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
|
||||
// number := rw.ValidateString(w, "number", r.PathValue("number"))
|
||||
// if number != "" {
|
||||
// return
|
||||
// }
|
||||
|
||||
// dto := e.UpdateDto{}
|
||||
// if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
|
||||
// return
|
||||
// }
|
||||
// dto.Number = &number
|
||||
// res, err := u.Update(dto)
|
||||
// rw.DataResponse(w, res, err)
|
||||
// }
|
||||
|
||||
// func (obj myBase) Delete(w http.ResponseWriter, r *http.Request) {
|
||||
// id := rw.ValidateInt(w, "id", r.PathValue("id"))
|
||||
// if id <= 0 {
|
||||
// return
|
||||
// }
|
||||
// dto := e.DeleteDto{}
|
||||
// dto.Id = uint(id)
|
||||
// res, err := u.Delete(dto)
|
||||
// rw.DataResponse(w, res, err)
|
||||
// }
|
||||
@@ -56,12 +56,12 @@ func (obj myBase) GetDetail(w http.ResponseWriter, r *http.Request) {
|
||||
// }
|
||||
|
||||
func (obj myBase) Delete(w http.ResponseWriter, r *http.Request) {
|
||||
id := rw.ValidateInt(w, "id", r.PathValue("id"))
|
||||
if id <= 0 {
|
||||
number := rw.ValidateString(w, "number", r.PathValue("number"))
|
||||
if number == "" {
|
||||
return
|
||||
}
|
||||
dto := e.DeleteDto{}
|
||||
dto.Id = uint(id)
|
||||
dto.Number = &number
|
||||
res, err := u.Delete(dto)
|
||||
rw.DataResponse(w, res, err)
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package migration
|
||||
|
||||
import (
|
||||
actionreport "simrs-vx/internal/domain/main-entities/action-report"
|
||||
adime "simrs-vx/internal/domain/main-entities/adime"
|
||||
admemployeehist "simrs-vx/internal/domain/main-entities/adm-employee-hist"
|
||||
ambulancetransportreq "simrs-vx/internal/domain/main-entities/ambulance-transport-req"
|
||||
@@ -88,6 +87,7 @@ import (
|
||||
practiceschedule "simrs-vx/internal/domain/main-entities/practice-schedule"
|
||||
prescription "simrs-vx/internal/domain/main-entities/prescription"
|
||||
prescriptionitem "simrs-vx/internal/domain/main-entities/prescription-item"
|
||||
procedurereport "simrs-vx/internal/domain/main-entities/procedure-report"
|
||||
procedureroom "simrs-vx/internal/domain/main-entities/procedure-room"
|
||||
procedureroomorder "simrs-vx/internal/domain/main-entities/procedure-room-order"
|
||||
procedureroomorderitem "simrs-vx/internal/domain/main-entities/procedure-room-order-item"
|
||||
@@ -96,6 +96,7 @@ import (
|
||||
radiologymcuorder "simrs-vx/internal/domain/main-entities/radiology-mcu-order"
|
||||
radiologymcuorderitem "simrs-vx/internal/domain/main-entities/radiology-mcu-order-item"
|
||||
regency "simrs-vx/internal/domain/main-entities/regency"
|
||||
registrator "simrs-vx/internal/domain/main-entities/registrator"
|
||||
rehab "simrs-vx/internal/domain/main-entities/rehab"
|
||||
responsibledoctorhist "simrs-vx/internal/domain/main-entities/responsible-doctor-hist"
|
||||
resume "simrs-vx/internal/domain/main-entities/resume"
|
||||
@@ -108,8 +109,6 @@ import (
|
||||
subspecialist "simrs-vx/internal/domain/main-entities/subspecialist"
|
||||
subspecialistposition "simrs-vx/internal/domain/main-entities/subspecialist-position"
|
||||
therapyprotocol "simrs-vx/internal/domain/main-entities/therapy-protocol"
|
||||
unit "simrs-vx/internal/domain/main-entities/unit"
|
||||
unitposition "simrs-vx/internal/domain/main-entities/unit-position"
|
||||
uom "simrs-vx/internal/domain/main-entities/uom"
|
||||
user "simrs-vx/internal/domain/main-entities/user"
|
||||
userfes "simrs-vx/internal/domain/main-entities/user-fes"
|
||||
@@ -134,7 +133,6 @@ func getMainEntities() []any {
|
||||
&division.Division{},
|
||||
&divisionposition.DivisionPosition{},
|
||||
&installation.Installation{},
|
||||
&unit.Unit{},
|
||||
&village.Village{},
|
||||
&district.District{},
|
||||
®ency.Regency{},
|
||||
@@ -148,6 +146,7 @@ func getMainEntities() []any {
|
||||
&proceduresrc.ProcedureSrc{},
|
||||
&employee.Employee{},
|
||||
&intern.Intern{},
|
||||
®istrator.Registrator{},
|
||||
&doctor.Doctor{},
|
||||
&nurse.Nurse{},
|
||||
&nutritionist.Nutritionist{},
|
||||
@@ -235,7 +234,6 @@ func getMainEntities() []any {
|
||||
&generalconsent.GeneralConsent{},
|
||||
&deathcause.DeathCause{},
|
||||
&installationposition.InstallationPosition{},
|
||||
&unitposition.UnitPosition{},
|
||||
&specialistposition.SpecialistPosition{},
|
||||
&subspecialistposition.SubspecialistPosition{},
|
||||
&responsibledoctorhist.ResponsibleDoctorHist{},
|
||||
@@ -249,7 +247,7 @@ func getMainEntities() []any {
|
||||
&resume.Resume{},
|
||||
&vclaimreference.VclaimReference{},
|
||||
&screening.Screening{},
|
||||
&actionreport.ActionReport{},
|
||||
&procedurereport.ProcedureReport{},
|
||||
&chemoplan.ChemoPlan{},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,5 +39,4 @@ func getEntities(input string) []any {
|
||||
|
||||
func Migrate(input string) {
|
||||
loader(input)
|
||||
|
||||
}
|
||||
|
||||
@@ -3,9 +3,11 @@ package migration
|
||||
import (
|
||||
/************** Source ***************/
|
||||
division "simrs-vx/internal/domain/sync-entities/division"
|
||||
doctor "simrs-vx/internal/domain/sync-entities/doctor"
|
||||
encounter "simrs-vx/internal/domain/sync-entities/encounter"
|
||||
installation "simrs-vx/internal/domain/sync-entities/installation"
|
||||
internalreference "simrs-vx/internal/domain/sync-entities/internal-reference"
|
||||
nurse "simrs-vx/internal/domain/sync-entities/nurse"
|
||||
patient "simrs-vx/internal/domain/sync-entities/patient"
|
||||
soapi "simrs-vx/internal/domain/sync-entities/soapi"
|
||||
specialist "simrs-vx/internal/domain/sync-entities/specialist"
|
||||
@@ -42,5 +44,11 @@ func getSyncEntities() []any {
|
||||
&soapi.SoapiLink{},
|
||||
&soapi.SoapiSimxLog{},
|
||||
&soapi.SoapiSimgosLog{},
|
||||
&doctor.DoctorLink{},
|
||||
&doctor.DoctorSimxLog{},
|
||||
&doctor.DoctorSimgosLog{},
|
||||
&nurse.NurseLink{},
|
||||
&nurse.NurseSimxLog{},
|
||||
&nurse.NurseSimgosLog{},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,32 +87,32 @@ func (obj myBase) UpdateStatus(w http.ResponseWriter, r *http.Request) {
|
||||
rw.DataResponse(w, res, err)
|
||||
}
|
||||
|
||||
func (obj myBase) RequestSwitchUnit(w http.ResponseWriter, r *http.Request) {
|
||||
func (obj myBase) RequestSwitchSpecialist(w http.ResponseWriter, r *http.Request) {
|
||||
dto := e.Encounter{}
|
||||
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
|
||||
return
|
||||
}
|
||||
|
||||
res, err := u.RequestSwitchUnit(dto)
|
||||
res, err := u.RequestSwitchSpecialist(dto)
|
||||
rw.DataResponse(w, res, err)
|
||||
}
|
||||
|
||||
func (obj myBase) ApproveSwitchUnit(w http.ResponseWriter, r *http.Request) {
|
||||
dto := e.ApproveCancelUnitDto{}
|
||||
func (obj myBase) ApproveSwitchSpecialist(w http.ResponseWriter, r *http.Request) {
|
||||
dto := e.ApproveCancelSpecialistDto{}
|
||||
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
|
||||
return
|
||||
}
|
||||
|
||||
res, err := u.ApproveSwitchUnit(dto)
|
||||
res, err := u.ApproveSwitchSpecialist(dto)
|
||||
rw.DataResponse(w, res, err)
|
||||
}
|
||||
|
||||
func (obj myBase) CancelSwitchUnit(w http.ResponseWriter, r *http.Request) {
|
||||
dto := e.ApproveCancelUnitDto{}
|
||||
func (obj myBase) CancelSwitchSpecialist(w http.ResponseWriter, r *http.Request) {
|
||||
dto := e.ApproveCancelSpecialistDto{}
|
||||
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
|
||||
return
|
||||
}
|
||||
|
||||
res, err := u.CancelSwitchUnit(dto)
|
||||
res, err := u.CancelSwitchSpecialist(dto)
|
||||
rw.DataResponse(w, res, err)
|
||||
}
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
package unit
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
rw "github.com/karincake/risoles"
|
||||
// ua "github.com/karincake/tumpeng/auth/svc"
|
||||
|
||||
e "simrs-vx/internal/domain/main-entities/unit"
|
||||
esync "simrs-vx/internal/domain/sync-entities/log"
|
||||
|
||||
u "simrs-vx/internal/use-case/simgos-sync-use-case/new/unit"
|
||||
)
|
||||
|
||||
type myBase struct{}
|
||||
|
||||
var O myBase
|
||||
|
||||
func (obj myBase) Create(w http.ResponseWriter, r *http.Request) {
|
||||
dto := e.CreateDto{}
|
||||
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
|
||||
return
|
||||
}
|
||||
res, err := u.Create(dto)
|
||||
rw.DataResponse(w, res, err)
|
||||
}
|
||||
|
||||
func (obj myBase) CreateLog(w http.ResponseWriter, r *http.Request) {
|
||||
dto := esync.SimxLogDto{}
|
||||
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
|
||||
return
|
||||
}
|
||||
res, err := u.CreateSimxLog(dto)
|
||||
rw.DataResponse(w, res, err)
|
||||
}
|
||||
|
||||
func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
|
||||
id := rw.ValidateInt(w, "id", r.PathValue("id"))
|
||||
if id <= 0 {
|
||||
return
|
||||
}
|
||||
|
||||
dto := e.UpdateDto{}
|
||||
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
|
||||
return
|
||||
}
|
||||
|
||||
val := uint16(id)
|
||||
dto.Id = &val
|
||||
|
||||
res, err := u.Update(dto)
|
||||
rw.DataResponse(w, res, err)
|
||||
}
|
||||
|
||||
func (obj myBase) Delete(w http.ResponseWriter, r *http.Request) {
|
||||
id := rw.ValidateInt(w, "id", r.PathValue("id"))
|
||||
if id <= 0 {
|
||||
return
|
||||
}
|
||||
|
||||
dto := e.DeleteDto{}
|
||||
val := uint16(id)
|
||||
dto.Id = &val
|
||||
|
||||
res, err := u.Delete(dto)
|
||||
rw.DataResponse(w, res, err)
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package seeder
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
seeder "simrs-vx/internal/use-case/simgos-sync-use-case/seeder"
|
||||
main "simrs-vx/internal/use-case/simgos-sync-use-case/seeder/seeder"
|
||||
|
||||
rw "github.com/karincake/risoles"
|
||||
)
|
||||
|
||||
type myBase struct{}
|
||||
|
||||
var O myBase
|
||||
|
||||
func (obj myBase) Seeder(w http.ResponseWriter, r *http.Request) {
|
||||
dto := seeder.Dto{}
|
||||
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
|
||||
return
|
||||
}
|
||||
|
||||
res, err := main.SeedToSimx(dto)
|
||||
rw.DataResponse(w, res, err)
|
||||
}
|
||||
@@ -28,7 +28,8 @@ import (
|
||||
"simrs-vx/internal/interface/simgos-sync-handler/new/soapi"
|
||||
"simrs-vx/internal/interface/simgos-sync-handler/new/specialist"
|
||||
"simrs-vx/internal/interface/simgos-sync-handler/new/subspecialist"
|
||||
"simrs-vx/internal/interface/simgos-sync-handler/new/unit"
|
||||
|
||||
sd "simrs-vx/internal/interface/simgos-sync-handler/seeder"
|
||||
|
||||
oldpatient "simrs-vx/internal/interface/simgos-sync-handler/old/patient"
|
||||
|
||||
@@ -51,7 +52,6 @@ func SetRoutes() http.Handler {
|
||||
/******************** SvcToOld ******************/
|
||||
prefixnew := "/new-to-old"
|
||||
hc.SyncCrud(r, prefixnew+"/v1/installation", installation.O)
|
||||
hc.SyncCrud(r, prefixnew+"/v1/unit", unit.O)
|
||||
hc.SyncCrud(r, prefixnew+"/v1/division", division.O)
|
||||
hc.SyncCrud(r, prefixnew+"/v1/specialist", specialist.O)
|
||||
hc.SyncCrud(r, prefixnew+"/v1/subspecialist", subspecialist.O)
|
||||
@@ -70,12 +70,18 @@ func SetRoutes() http.Handler {
|
||||
"PATCH /{id}/checkin": encounter.O.Checkin,
|
||||
"PATCH /{id}/checkout": encounter.O.Checkout,
|
||||
"PATCH /{id}/update-status": encounter.O.UpdateStatus,
|
||||
"PATCH /{id}/req-switch-unit": encounter.O.RequestSwitchUnit,
|
||||
"PATCH /{id}/approve-switch-unit": encounter.O.ApproveSwitchUnit,
|
||||
"PATCH /{id}/cancel-switch-unit": encounter.O.CancelSwitchUnit,
|
||||
"PATCH /{id}/req-switch-unit": encounter.O.RequestSwitchSpecialist,
|
||||
"PATCH /{id}/approve-switch-unit": encounter.O.ApproveSwitchSpecialist,
|
||||
"PATCH /{id}/cancel-switch-unit": encounter.O.CancelSwitchSpecialist,
|
||||
})
|
||||
hc.SyncCrud(r, prefixnew+"/v1/soapi", soapi.O)
|
||||
|
||||
/******************** Seeder ******************/
|
||||
prefixseeder := "/seeder"
|
||||
hk.GroupRoutes(prefixseeder+"/v1", r, hk.MapHandlerFunc{
|
||||
"POST /": sd.O.Seeder,
|
||||
})
|
||||
|
||||
/******************** SvcToNew ******************/
|
||||
prefixold := "/old-to-new"
|
||||
hk.GroupRoutes(prefixold+"/v1/patient", r, oauth.OldGuardMW, hk.MapHandlerFunc{
|
||||
|
||||
@@ -104,3 +104,11 @@ func (a AuthInfo) IsNurseIntern() bool {
|
||||
func (a AuthInfo) HasEmployeePosition() bool {
|
||||
return a.Employee_Position_Code != nil
|
||||
}
|
||||
|
||||
func (a AuthInfo) IsReg() bool {
|
||||
return a.Employee_Position_Code != nil && *a.Employee_Position_Code == string(ero.EPCReg)
|
||||
}
|
||||
|
||||
func (a AuthInfo) IsSys() bool {
|
||||
return a.User_ContractPosition_Code == string(ero.CSCSys)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
package vclaimsepcontrolletter
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
e "simrs-vx/internal/domain/bpjs-entities/vclaim-sep-control-letter"
|
||||
|
||||
ibpjs "simrs-vx/internal/infra/bpjs"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
func CreateSepControlLetter(input *e.CreateDto, data *e.VclaimSepControlLetter, tx *gorm.DB) error {
|
||||
payload, err := input.RequestPayloadIntoJson()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
req, err := http.NewRequest("POST", ibpjs.O.BaseUrl+"RencanaKontrol", bytes.NewBuffer(payload))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
req.Header.Set("Content-Type", "application/json")
|
||||
|
||||
resp, err := http.DefaultClient.Do(req)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
body, err := io.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var vresp Response
|
||||
if err := json.Unmarshal(body, &vresp); err != nil {
|
||||
return fmt.Errorf("failed to parse response JSON: %w", err)
|
||||
}
|
||||
|
||||
if vresp.MetaData.Code != "200" {
|
||||
return fmt.Errorf("failed to create sep control letter: %s", vresp.MetaData.Message)
|
||||
}
|
||||
|
||||
pdfNeeds, err := vresp.ToPDFNeeds()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
tmp := string(pdfNeeds)
|
||||
input.Value = &tmp
|
||||
input.Number = &vresp.Response.NoSuratKontrol
|
||||
input.VclaimSep_Number = &vresp.Response.Sep.NoSep
|
||||
return nil
|
||||
}
|
||||
|
||||
// func ReadDetailSep(input *e.ReadDetailDto, data *e.VclaimSep, tx *gorm.DB) error {
|
||||
// endpoint := fmt.Sprintf("sep/%s", input.Number)
|
||||
// req, err := http.NewRequest("GET", ibpjs.O.BaseUrl+endpoint, nil)
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
// req.Header.Set("Content-Type", "application/json")
|
||||
|
||||
// resp, err := http.DefaultClient.Do(req)
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
// defer resp.Body.Close()
|
||||
|
||||
// body, err := io.ReadAll(resp.Body)
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
|
||||
// var detail e.SepResponse
|
||||
// if err := json.Unmarshal(body, &detail); err != nil {
|
||||
// return fmt.Errorf("failed to parse response JSON: %w", err)
|
||||
// }
|
||||
|
||||
// data.Detail = detail.Response
|
||||
|
||||
// return nil
|
||||
// }
|
||||
|
||||
// func DeleteSep(input *e.DeleteDto, data *e.VclaimSep, tx *gorm.DB) error {
|
||||
// payload := e.SepDeleteRequest{}
|
||||
// payload.Request.TSep.NoSep = *input.Number
|
||||
// payload.Request.TSep.User = "Coba Ws"
|
||||
|
||||
// jsonPayload, err := json.Marshal(payload)
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
|
||||
// req, err := http.NewRequest("DELETE", ibpjs.O.BaseUrl+"sep", bytes.NewBuffer(jsonPayload))
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
|
||||
// req.Header.Set("Content-Type", "application/json")
|
||||
|
||||
// resp, err := http.DefaultClient.Do(req)
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
// defer resp.Body.Close()
|
||||
|
||||
// body, err := io.ReadAll(resp.Body)
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
|
||||
// var detail e.SepResponse
|
||||
// if err := json.Unmarshal(body, &detail); err != nil {
|
||||
// return fmt.Errorf("failed to parse response JSON: %w", err)
|
||||
// }
|
||||
|
||||
// if detail.MetaData.Message == SepNotFound {
|
||||
// return fmt.Errorf("sep with number %s not found", *data.Number)
|
||||
// }
|
||||
|
||||
// return nil
|
||||
// }
|
||||
@@ -0,0 +1,87 @@
|
||||
package vclaimsepcontrolletter
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
e "simrs-vx/internal/domain/bpjs-entities/vclaim-sep-control-letter"
|
||||
)
|
||||
|
||||
type SuratKontrol struct {
|
||||
NoSuratKontrol string `json:"noSuratKontrol"`
|
||||
TglRencanaKontrol string `json:"tglRencanaKontrol"`
|
||||
TglTerbit string `json:"tglTerbit"`
|
||||
JnsKontrol string `json:"jnsKontrol"`
|
||||
PoliTujuan string `json:"poliTujuan"`
|
||||
NamaPoliTujuan string `json:"namaPoliTujuan"`
|
||||
KodeDokter string `json:"kodeDokter"`
|
||||
NamaDokter string `json:"namaDokter"`
|
||||
FlagKontrol string `json:"flagKontrol"`
|
||||
KodeDokterPembuat *string `json:"kodeDokterPembuat"`
|
||||
NamaDokterPembuat *string `json:"namaDokterPembuat"`
|
||||
NamaJnsKontrol string `json:"namaJnsKontrol"`
|
||||
Sep Sep `json:"sep"`
|
||||
}
|
||||
|
||||
type Sep struct {
|
||||
NoSep string `json:"noSep"`
|
||||
TglSep string `json:"tglSep"`
|
||||
JnsPelayanan string `json:"jnsPelayanan"`
|
||||
Poli string `json:"poli"`
|
||||
Diagnosa string `json:"diagnosa"`
|
||||
Peserta Peserta `json:"peserta"`
|
||||
ProvUmum ProvUmum `json:"provUmum"`
|
||||
ProvPerujuk ProvPerujuk `json:"provPerujuk"`
|
||||
}
|
||||
|
||||
type Peserta struct {
|
||||
NoKartu string `json:"noKartu"`
|
||||
Nama string `json:"nama"`
|
||||
TglLahir string `json:"tglLahir"`
|
||||
Kelamin string `json:"kelamin"`
|
||||
HakKelas string `json:"hakKelas"`
|
||||
}
|
||||
|
||||
type ProvUmum struct {
|
||||
KdProvider string `json:"kdProvider"`
|
||||
NmProvider string `json:"nmProvider"`
|
||||
}
|
||||
|
||||
type ProvPerujuk struct {
|
||||
KdProviderPerujuk string `json:"kdProviderPerujuk"`
|
||||
NmProviderPerujuk string `json:"nmProviderPerujuk"`
|
||||
AsalRujukan string `json:"asalRujukan"`
|
||||
NoRujukan string `json:"noRujukan"`
|
||||
TglRujukan string `json:"tglRujukan"`
|
||||
}
|
||||
|
||||
type Response struct {
|
||||
MetaData MetaData `json:"metaData"`
|
||||
Response *SuratKontrol `json:"response"` // nullable
|
||||
}
|
||||
|
||||
type MetaData struct {
|
||||
Code string `json:"code"`
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
func (r Response) ToPDFNeeds() ([]byte, error) {
|
||||
response := e.ResponseForPDF{
|
||||
Number: r.Response.Sep.NoSep,
|
||||
PlannedControlDate: r.Response.TglRencanaKontrol,
|
||||
IssuedDate: r.Response.TglTerbit,
|
||||
Doctor_Name: r.Response.NamaDokter,
|
||||
DstUnit_Name: r.Response.NamaPoliTujuan,
|
||||
ResponsibleDoctor_Name: *r.Response.NamaDokterPembuat,
|
||||
VclaimSep: e.VclaimSep{
|
||||
VclaimMember: e.VclaimMember{
|
||||
CardNumber: r.Response.Sep.Peserta.NoKartu,
|
||||
Name: r.Response.Sep.Peserta.Nama,
|
||||
BirthDate: r.Response.Sep.Peserta.TglLahir,
|
||||
Gender: r.Response.Sep.Peserta.Kelamin,
|
||||
},
|
||||
Diagnose: r.Response.Sep.Diagnosa,
|
||||
Number: r.Response.Sep.NoSep,
|
||||
},
|
||||
}
|
||||
return json.Marshal(response)
|
||||
}
|
||||
@@ -20,5 +20,5 @@ func setData[T *e.CreateDto | *e.UpdateDto](input T, data *e.VclaimSepControlLet
|
||||
data.VclaimSep_Number = inputSrc.VclaimSep_Number
|
||||
data.Number = inputSrc.Number
|
||||
data.Value = inputSrc.Value
|
||||
data.FileUrl = inputSrc.FileUrl
|
||||
// data.FileUrl = inputSrc.FileUrl
|
||||
}
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package vclaimsepcontrolletter
|
||||
|
||||
import (
|
||||
pvscl "simrs-vx/internal/use-case/bpjs-plugin/vclaim-sep-control-letter"
|
||||
)
|
||||
|
||||
// example of middleware
|
||||
// func init() {
|
||||
// createPreMw = append(createPreMw,
|
||||
// CreateMw{Name: "modif-input", Func: pm.ModifInput},
|
||||
// CreateMw{Name: "check-data", Func: pm.CheckData},
|
||||
// )
|
||||
// }
|
||||
func init() {
|
||||
createPreMw = append(createPreMw,
|
||||
createMw{Name: "create-sep-control-letter", Func: pvscl.CreateSepControlLetter},
|
||||
)
|
||||
}
|
||||
|
||||
@@ -246,7 +246,7 @@ func Update(input e.UpdateDto) (*d.Data, error) {
|
||||
}
|
||||
|
||||
func Delete(input e.DeleteDto) (*d.Data, error) {
|
||||
rdDto := e.ReadDetailDto{Id: input.Id}
|
||||
rdDto := e.ReadDetailDto{Number: input.Number}
|
||||
var data *e.VclaimSep
|
||||
var err error
|
||||
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
/*
|
||||
DESCRIPTION:
|
||||
Any functions that are used internally by the use-case
|
||||
*/
|
||||
package actionreport
|
||||
|
||||
import (
|
||||
e "simrs-vx/internal/domain/main-entities/action-report"
|
||||
)
|
||||
|
||||
func setData[T *e.CreateDto | *e.UpdateDto](input T, data *e.ActionReport) {
|
||||
var inputSrc *e.CreateDto
|
||||
if inputT, ok := any(input).(*e.CreateDto); ok {
|
||||
inputSrc = inputT
|
||||
} else {
|
||||
inputTemp := any(input).(*e.UpdateDto)
|
||||
inputSrc = &inputTemp.CreateDto
|
||||
}
|
||||
|
||||
data.Encounter_Id = inputSrc.Encounter_Id
|
||||
data.Date = inputSrc.Date
|
||||
data.Doctor_Code = inputSrc.Doctor_Code
|
||||
data.Operator_Employe_Id = inputSrc.Operator_Employe_Id
|
||||
data.Assistant_Employe_Id = inputSrc.Assistant_Employe_Id
|
||||
data.Instrumentor_Employe_Id = inputSrc.Instrumentor_Employe_Id
|
||||
data.Nurse_Code = inputSrc.Nurse_Code
|
||||
data.Value = inputSrc.Value
|
||||
}
|
||||
@@ -1,103 +0,0 @@
|
||||
package actionreport
|
||||
|
||||
import (
|
||||
e "simrs-vx/internal/domain/main-entities/action-report"
|
||||
pl "simrs-vx/pkg/logger"
|
||||
pu "simrs-vx/pkg/use-case-helper"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type middlewareRunner struct {
|
||||
Event *pl.Event
|
||||
Tx *gorm.DB
|
||||
MwType pu.MWType
|
||||
}
|
||||
|
||||
// NewMiddlewareExecutor creates a new middleware executor
|
||||
func newMiddlewareRunner(event *pl.Event, tx *gorm.DB) *middlewareRunner {
|
||||
return &middlewareRunner{
|
||||
Event: event,
|
||||
Tx: tx,
|
||||
}
|
||||
}
|
||||
|
||||
// ExecuteCreateMiddleware executes create middleware
|
||||
func (me *middlewareRunner) RunCreateMiddleware(middlewares []createMw, input *e.CreateDto, data *e.ActionReport) error {
|
||||
for _, middleware := range middlewares {
|
||||
logData := pu.GetLogData(input, data)
|
||||
|
||||
pl.SetLogInfo(me.Event, logData, "started", middleware.Name)
|
||||
|
||||
if err := middleware.Func(input, data, me.Tx); err != nil {
|
||||
return pu.HandleMiddlewareError(me.Event, string(me.MwType), middleware.Name, logData, err)
|
||||
}
|
||||
|
||||
pl.SetLogInfo(me.Event, nil, "complete")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (me *middlewareRunner) RunReadListMiddleware(middlewares []readListMw, input *e.ReadListDto, data *e.ActionReport) error {
|
||||
for _, middleware := range middlewares {
|
||||
logData := pu.GetLogData(input, data)
|
||||
|
||||
pl.SetLogInfo(me.Event, logData, "started", middleware.Name)
|
||||
|
||||
if err := middleware.Func(input, data, me.Tx); err != nil {
|
||||
return pu.HandleMiddlewareError(me.Event, string(me.MwType), middleware.Name, logData, err)
|
||||
}
|
||||
|
||||
pl.SetLogInfo(me.Event, nil, "complete")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (me *middlewareRunner) RunReadDetailMiddleware(middlewares []readDetailMw, input *e.ReadDetailDto, data *e.ActionReport) error {
|
||||
for _, middleware := range middlewares {
|
||||
logData := pu.GetLogData(input, data)
|
||||
|
||||
pl.SetLogInfo(me.Event, logData, "started", middleware.Name)
|
||||
|
||||
if err := middleware.Func(input, data, me.Tx); err != nil {
|
||||
return pu.HandleMiddlewareError(me.Event, string(me.MwType), middleware.Name, logData, err)
|
||||
}
|
||||
|
||||
pl.SetLogInfo(me.Event, nil, "complete")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (me *middlewareRunner) RunUpdateMiddleware(middlewares []readDetailMw, input *e.ReadDetailDto, data *e.ActionReport) error {
|
||||
for _, middleware := range middlewares {
|
||||
logData := pu.GetLogData(input, data)
|
||||
|
||||
pl.SetLogInfo(me.Event, logData, "started", middleware.Name)
|
||||
|
||||
if err := middleware.Func(input, data, me.Tx); err != nil {
|
||||
return pu.HandleMiddlewareError(me.Event, string(me.MwType), middleware.Name, logData, err)
|
||||
}
|
||||
|
||||
pl.SetLogInfo(me.Event, nil, "complete")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (me *middlewareRunner) RunDeleteMiddleware(middlewares []readDetailMw, input *e.ReadDetailDto, data *e.ActionReport) error {
|
||||
for _, middleware := range middlewares {
|
||||
logData := pu.GetLogData(input, data)
|
||||
|
||||
pl.SetLogInfo(me.Event, logData, "started", middleware.Name)
|
||||
|
||||
if err := middleware.Func(input, data, me.Tx); err != nil {
|
||||
return pu.HandleMiddlewareError(me.Event, string(me.MwType), middleware.Name, logData, err)
|
||||
}
|
||||
|
||||
pl.SetLogInfo(me.Event, nil, "complete")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (me *middlewareRunner) setMwType(mwType pu.MWType) {
|
||||
me.MwType = mwType
|
||||
}
|
||||
@@ -26,16 +26,15 @@ import (
|
||||
em "simrs-vx/internal/domain/main-entities/midwife"
|
||||
en "simrs-vx/internal/domain/main-entities/nurse"
|
||||
ep "simrs-vx/internal/domain/main-entities/pharmacist"
|
||||
er "simrs-vx/internal/domain/main-entities/registrator"
|
||||
esp "simrs-vx/internal/domain/main-entities/specialist-position"
|
||||
essp "simrs-vx/internal/domain/main-entities/subspecialist-position"
|
||||
eup "simrs-vx/internal/domain/main-entities/unit-position"
|
||||
eu "simrs-vx/internal/domain/main-entities/user"
|
||||
|
||||
udp "simrs-vx/internal/use-case/main-use-case/division-position"
|
||||
uip "simrs-vx/internal/use-case/main-use-case/installation-position"
|
||||
usp "simrs-vx/internal/use-case/main-use-case/specialist-position"
|
||||
ussp "simrs-vx/internal/use-case/main-use-case/subspecialist-position"
|
||||
uup "simrs-vx/internal/use-case/main-use-case/unit-position"
|
||||
)
|
||||
|
||||
// just return the error code
|
||||
@@ -84,7 +83,7 @@ func getDivisionPosition(employee_id uint, event *pl.Event) ([]string, error) {
|
||||
func getInstallationPosition(employeeId uint, event *pl.Event) ([]string, error) {
|
||||
var result []string
|
||||
|
||||
// get data unit_position based on employee_id
|
||||
// get data specialist_position based on employee_id
|
||||
data, _, err := uip.ReadListData(eip.ReadListDto{
|
||||
FilterDto: eip.FilterDto{Employee_Id: &employeeId},
|
||||
Includes: "installation"}, event)
|
||||
@@ -101,28 +100,10 @@ func getInstallationPosition(employeeId uint, event *pl.Event) ([]string, error)
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func getUnitPosition(employeeId uint, event *pl.Event) ([]string, error) {
|
||||
var result []string
|
||||
|
||||
// get data unit_position based on employee_id
|
||||
data, _, err := uup.ReadListData(eup.ReadListDto{FilterDto: eup.FilterDto{Employee_Id: &employeeId}}, event)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if len(data) > 0 {
|
||||
for _, dp := range data {
|
||||
result = append(result, "unit|"+*dp.Unit_Code+"|"+dp.Code)
|
||||
}
|
||||
}
|
||||
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func getSpecialistPosition(employeeId uint, event *pl.Event) ([]string, error) {
|
||||
var result []string
|
||||
|
||||
// get data unit_position based on employee_id
|
||||
// get data specialist_position based on employee_id
|
||||
data, _, err := usp.ReadListData(esp.ReadListDto{FilterDto: esp.FilterDto{Employee_Id: &employeeId}}, event)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -140,7 +121,7 @@ func getSpecialistPosition(employeeId uint, event *pl.Event) ([]string, error) {
|
||||
func getSubspecialistPosition(employeeId uint, event *pl.Event) ([]string, error) {
|
||||
var result []string
|
||||
|
||||
// get data unit_position based on employee_id
|
||||
// get data specialist_position based on employee_id
|
||||
data, _, err := ussp.ReadListData(essp.ReadListDto{
|
||||
FilterDto: essp.FilterDto{Employee_Id: &employeeId},
|
||||
Includes: "subspecialist"}, event)
|
||||
@@ -229,9 +210,9 @@ func populateRoles(user *eu.User, input eu.LoginDto, atClaims jwt.MapClaims, out
|
||||
outputData["doctor_code"] = doctor.Code
|
||||
|
||||
// specialist
|
||||
if doctor.Unit_Code != nil {
|
||||
atClaims["unit_code"] = doctor.Unit_Code
|
||||
outputData["unit_code"] = doctor.Unit_Code
|
||||
if doctor.Specialist_Code != nil {
|
||||
atClaims["specialist_code"] = doctor.Specialist_Code
|
||||
outputData["specialist_code"] = doctor.Specialist_Code
|
||||
}
|
||||
if doctor.Specialist_Code != nil {
|
||||
atClaims["specialist_code"] = doctor.Specialist_Code
|
||||
@@ -265,6 +246,16 @@ func populateRoles(user *eu.User, input eu.LoginDto, atClaims jwt.MapClaims, out
|
||||
}
|
||||
atClaims["pharmacist_code"] = empData.Code
|
||||
outputData["pharmacist_code"] = empData.Code
|
||||
case erg.EPCReg:
|
||||
empData := er.Registrator{}
|
||||
dg.I.Where("\"Employee_Id\" = ?", employee.Id).First(&empData)
|
||||
if empData.Id == 0 {
|
||||
return d.FieldErrors{"authentication": d.FieldError{Code: "auth-noRegistrator", Message: pl.GenMessage("auth-noRegistrator")}}
|
||||
}
|
||||
atClaims["registrator_id"] = empData.Id
|
||||
outputData["registrator_id"] = empData.Id
|
||||
atClaims["installation_code"] = empData.Installation_Code
|
||||
outputData["installation_code"] = empData.Installation_Code
|
||||
}
|
||||
|
||||
errorGetPosition := d.FieldErrors{"authentication": d.FieldError{Code: "auth-getData-failed", Message: pl.GenMessage("auth-getData-failed")}}
|
||||
@@ -281,12 +272,6 @@ func populateRoles(user *eu.User, input eu.LoginDto, atClaims jwt.MapClaims, out
|
||||
return errorGetPosition
|
||||
}
|
||||
|
||||
// unit position
|
||||
unitPositions, err := getUnitPosition(employee.Id, &event)
|
||||
if err != nil {
|
||||
return errorGetPosition
|
||||
}
|
||||
|
||||
// specialist position
|
||||
specialistPositions, err := getSpecialistPosition(employee.Id, &event)
|
||||
if err != nil {
|
||||
@@ -301,7 +286,7 @@ func populateRoles(user *eu.User, input eu.LoginDto, atClaims jwt.MapClaims, out
|
||||
|
||||
roles = append(roles, divisionPositions...)
|
||||
roles = append(roles, installationPositions...)
|
||||
roles = append(roles, unitPositions...)
|
||||
roles = append(roles, specialistPositions...)
|
||||
roles = append(roles, specialistPositions...)
|
||||
roles = append(roles, subspecialistPositions...)
|
||||
// atClaims["division_positions"] = divsionPositions
|
||||
|
||||
@@ -19,5 +19,5 @@ func setData[T *e.CreateDto | *e.UpdateDto](input T, data *e.Chemo) {
|
||||
|
||||
data.Encounter_Id = inputSrc.Encounter_Id
|
||||
data.Status_Code = inputSrc.Status_Code
|
||||
data.SrcUnit_Code = inputSrc.SrcUnit_Code
|
||||
data.Specialist_Code = inputSrc.Specialist_Code
|
||||
}
|
||||
|
||||
@@ -312,7 +312,7 @@ func Reply(input e.ReplyDto) (*d.Data, error) {
|
||||
return pl.SetLogError(&event, input)
|
||||
}
|
||||
|
||||
if data.DstDoctor_Code != nil && data.DstDoctor_Code != input.AuthInfo.Doctor_Code {
|
||||
if data.Doctor_Code != nil && data.Doctor_Code != input.AuthInfo.Doctor_Code {
|
||||
event.Status = "failed"
|
||||
event.ErrInfo = pl.ErrorInfo{
|
||||
Code: "data-handled-mismatch",
|
||||
@@ -322,7 +322,7 @@ func Reply(input e.ReplyDto) (*d.Data, error) {
|
||||
return pl.SetLogError(&event, input)
|
||||
}
|
||||
|
||||
data.DstDoctor_Code = input.AuthInfo.Doctor_Code
|
||||
data.Doctor_Code = input.AuthInfo.Doctor_Code
|
||||
data.Solution = input.Solution
|
||||
data.RepliedAt = pu.GetTimeNow()
|
||||
err = tx.Save(&data).Error
|
||||
|
||||
@@ -20,5 +20,5 @@ func setData[T *e.CreateDto | *e.UpdateDto](input T, data *e.Consultation) {
|
||||
data.Encounter_Id = inputSrc.Encounter_Id
|
||||
data.Date = inputSrc.Date
|
||||
data.Problem = inputSrc.Problem
|
||||
data.DstUnit_Code = inputSrc.DstUnit_Code
|
||||
data.Specialist_Code = inputSrc.Specialist_Code
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@ func setData[T *e.CreateDto | *e.UpdateDto](input T, data *e.ControlLetter) {
|
||||
}
|
||||
|
||||
data.Encounter_Id = inputSrc.Encounter_Id
|
||||
data.Unit_Code = inputSrc.Unit_Code
|
||||
data.Specialist_Code = inputSrc.Specialist_Code
|
||||
data.Subspecialist_Code = inputSrc.Subspecialist_Code
|
||||
data.Doctor_Code = inputSrc.Doctor_Code
|
||||
|
||||
@@ -21,7 +21,6 @@ func setData[T *e.CreateDto | *e.UpdateDto](input T, data *e.Doctor) {
|
||||
data.Employee_Id = inputSrc.Employee_Id
|
||||
data.IHS_Number = inputSrc.IHS_Number
|
||||
data.SIP_Number = inputSrc.SIP_Number
|
||||
data.Unit_Code = inputSrc.Unit_Code
|
||||
data.Specialist_Code = inputSrc.Specialist_Code
|
||||
data.Subspecialist_Code = inputSrc.Subspecialist_Code
|
||||
}
|
||||
|
||||
@@ -22,12 +22,14 @@ import (
|
||||
edc "simrs-vx/internal/domain/main-entities/death-cause"
|
||||
e "simrs-vx/internal/domain/main-entities/encounter"
|
||||
eir "simrs-vx/internal/domain/main-entities/internal-reference"
|
||||
ep "simrs-vx/internal/domain/main-entities/patient"
|
||||
es "simrs-vx/internal/domain/main-entities/soapi"
|
||||
esync "simrs-vx/internal/domain/sync-entities/log"
|
||||
|
||||
uv "simrs-vx/internal/use-case/bpjs-use-case/vclaim-reference"
|
||||
udc "simrs-vx/internal/use-case/main-use-case/death-cause"
|
||||
uir "simrs-vx/internal/use-case/main-use-case/internal-reference"
|
||||
up "simrs-vx/internal/use-case/main-use-case/patient"
|
||||
us "simrs-vx/internal/use-case/main-use-case/soapi"
|
||||
)
|
||||
|
||||
@@ -702,13 +704,13 @@ func CheckIn(input e.CheckinDto) (*d.Data, error) {
|
||||
}, nil
|
||||
}
|
||||
|
||||
func RequestSwitchUnit(input e.SwitchUnitDto) (*d.Data, error) {
|
||||
func RequestSwitchSpecialist(input e.SwitchSpecialistDto) (*d.Data, error) {
|
||||
rdDto := e.ReadDetailDto{Id: input.Id, Includes: "Responsible_Nurse.Employee.User,Responsible_Doctor.Employee"}
|
||||
var data *e.Encounter
|
||||
var err error
|
||||
|
||||
event := pl.Event{
|
||||
Feature: "RequestSwitchUnit",
|
||||
Feature: "RequestSwitchSpecialist",
|
||||
Source: source,
|
||||
}
|
||||
|
||||
@@ -718,8 +720,8 @@ func RequestSwitchUnit(input e.SwitchUnitDto) (*d.Data, error) {
|
||||
unitCodes := make(map[string]struct{})
|
||||
doctorCodes := make(map[string]struct{})
|
||||
for _, ref := range *input.InternalReferences {
|
||||
if ref.Unit_Code != nil {
|
||||
unitCodes[*ref.Unit_Code] = struct{}{}
|
||||
if ref.Specialist_Code != nil {
|
||||
unitCodes[*ref.Specialist_Code] = struct{}{}
|
||||
}
|
||||
if ref.Doctor_Code != nil {
|
||||
doctorCodes[*ref.Doctor_Code] = struct{}{}
|
||||
@@ -727,7 +729,7 @@ func RequestSwitchUnit(input e.SwitchUnitDto) (*d.Data, error) {
|
||||
}
|
||||
|
||||
// validate unit
|
||||
if err = validateUnitCodes(unitCodes, &event); err != nil {
|
||||
if err = validateSpecialistCodes(unitCodes, &event); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -794,7 +796,7 @@ func RequestSwitchUnit(input e.SwitchUnitDto) (*d.Data, error) {
|
||||
|
||||
mwRunner.setMwType(pu.MWTPre)
|
||||
// Run pre-middleware
|
||||
if err := mwRunner.RunRequestSwitchUnitMiddleware(requestSwitchEncounter, dataEncounter); err != nil {
|
||||
if err := mwRunner.RunRequestSwitchSpecialistMiddleware(requestSwitchEncounter, dataEncounter); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
@@ -810,13 +812,13 @@ func RequestSwitchUnit(input e.SwitchUnitDto) (*d.Data, error) {
|
||||
Meta: d.IS{
|
||||
"source": source,
|
||||
"structure": "single-data",
|
||||
"status": "requestSwitchUnit",
|
||||
"status": "requestSwitchSpecialist",
|
||||
},
|
||||
Data: data.ToResponse(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func ApproveSwitchUnit(input e.ApproveCancelUnitDto) (*d.Data, error) {
|
||||
func ApproveSwitchSpecialist(input e.ApproveCancelSpecialistDto) (*d.Data, error) {
|
||||
rdDto := e.ReadDetailDto{Id: input.Id, Includes: "Responsible_Doctor.Employee"}
|
||||
var (
|
||||
data *e.Encounter
|
||||
@@ -824,12 +826,12 @@ func ApproveSwitchUnit(input e.ApproveCancelUnitDto) (*d.Data, error) {
|
||||
)
|
||||
|
||||
event := pl.Event{
|
||||
Feature: "ApproveSwitchUnit",
|
||||
Feature: "ApproveSwitchSpecialist",
|
||||
Source: source,
|
||||
}
|
||||
|
||||
// Start log
|
||||
pl.SetLogInfo(&event, input, "started", "approveSwitchUnit")
|
||||
pl.SetLogInfo(&event, input, "started", "approveSwitchSpecialist")
|
||||
|
||||
roleAllowed := []string{string(erg.EPCNur)}
|
||||
err = validateAuth(input.AuthInfo, roleAllowed, "request-switch-poly", &event)
|
||||
@@ -902,13 +904,13 @@ func ApproveSwitchUnit(input e.ApproveCancelUnitDto) (*d.Data, error) {
|
||||
}
|
||||
|
||||
// update encounter
|
||||
if err = updateEncounterApproveSwitchUnit(input, &event, tx); err != nil {
|
||||
if err = updateEncounterApproveSwitchSpecialist(input, &event, tx); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
mwRunner.setMwType(pu.MWTPre)
|
||||
// Run pre-middleware
|
||||
if err := mwRunner.RunApproveSwitchUnitMiddleware(approveSwitchEncounter, &input); err != nil {
|
||||
if err := mwRunner.RunApproveSwitchSpecialistMiddleware(approveSwitchEncounter, &input); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
@@ -931,7 +933,7 @@ func ApproveSwitchUnit(input e.ApproveCancelUnitDto) (*d.Data, error) {
|
||||
|
||||
}
|
||||
|
||||
func CancelSwitchUnit(input e.ApproveCancelUnitDto) (*d.Data, error) {
|
||||
func CancelSwitchSpecialist(input e.ApproveCancelSpecialistDto) (*d.Data, error) {
|
||||
rdDto := e.ReadDetailDto{Id: input.Id}
|
||||
var (
|
||||
data *e.Encounter
|
||||
@@ -939,12 +941,12 @@ func CancelSwitchUnit(input e.ApproveCancelUnitDto) (*d.Data, error) {
|
||||
)
|
||||
|
||||
event := pl.Event{
|
||||
Feature: "CancelSwitchUnit",
|
||||
Feature: "CancelSwitchSpecialist",
|
||||
Source: source,
|
||||
}
|
||||
|
||||
// Start log
|
||||
pl.SetLogInfo(&event, input, "started", "cancelSwitchUnit")
|
||||
pl.SetLogInfo(&event, input, "started", "cancelSwitchSpecialist")
|
||||
|
||||
roleAllowed := []string{string(erg.EPCNur)}
|
||||
err = validateAuth(input.AuthInfo, roleAllowed, "request-switch-poly", &event)
|
||||
@@ -998,7 +1000,7 @@ func CancelSwitchUnit(input e.ApproveCancelUnitDto) (*d.Data, error) {
|
||||
|
||||
mwRunner.setMwType(pu.MWTPre)
|
||||
// Run pre-middleware
|
||||
if err := mwRunner.RunCancelSwitchUnitMiddleware(cancelSwitchEncounter, &input); err != nil {
|
||||
if err := mwRunner.RunCancelSwitchSpecialistMiddleware(cancelSwitchEncounter, &input); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
@@ -1075,3 +1077,144 @@ func validateAuth(a auth.AuthInfo, roleAllowed []string, action string, event *p
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func CreateWithPatient(input e.CreateWithPatientDto) (*d.Data, error) {
|
||||
var (
|
||||
data e.Encounter
|
||||
recentSoapiDataforCopy []es.CreateDto
|
||||
err error
|
||||
)
|
||||
|
||||
event := pl.Event{
|
||||
Feature: "Create",
|
||||
Source: source,
|
||||
}
|
||||
|
||||
// Start log
|
||||
pl.SetLogInfo(&event, input, "started", "create")
|
||||
|
||||
roleAllowed := []string{string(erg.EPCReg)}
|
||||
err = validateAuth(input.Encounter.AuthInfo, roleAllowed, "create-encounter", &event)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// validate rehab by bpjs
|
||||
if input.Encounter.RefTypeCode == ere.RTCBpjs &&
|
||||
input.Encounter.Class_Code == ere.ECAmbulatory &&
|
||||
ere.AmbulatoryClassCode(*input.Encounter.SubClass_Code) == ere.ACCRehab {
|
||||
// get latest rehab data
|
||||
recentRehabData, err := getLatestRehabData(input.Encounter, &event)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// If recentRehabData is nil, then visitMode_Code = "adm"
|
||||
if recentRehabData != nil {
|
||||
// If recentRehabData is not nil, determine the visitMode_Code:
|
||||
// If the mode is "series", verify whether the visit count still remains
|
||||
// and whether the series has not expired.
|
||||
// If visitMode is "series", then get encounterAdm
|
||||
input.Encounter.VisitMode_Code, input.Encounter.RecentEncounterAdm, err = determineVisitMode(recentRehabData, input.Encounter, &event)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
} else {
|
||||
input.Encounter.VisitMode_Code = ere.VMCAdm
|
||||
}
|
||||
|
||||
// When visitMode_Code is "series", load the associated SOAPI record to copy its values.
|
||||
if input.Encounter.VisitMode_Code == ere.VMCSeries {
|
||||
// get data soapi
|
||||
recentSoapiDataforCopy, err = getSoapiEncounterAdm(*input.Encounter.RecentEncounterAdm, &event)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// check if patient is new in the hospital
|
||||
input.Encounter.NewStatus, err = identifyPatientStatus(input.Encounter)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
input.Encounter.Adm_Employee_Id = input.Encounter.AuthInfo.Employee_Id
|
||||
|
||||
mwRunner := newMiddlewareRunner(&event, input.Encounter.Sync)
|
||||
|
||||
err = dg.I.Transaction(func(tx *gorm.DB) error {
|
||||
// create patient
|
||||
var patientId uint
|
||||
patientData, err := up.Create(input.Patient, tx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if patientData != nil {
|
||||
patientId = patientData.Data.(ep.ResponseDto).Id
|
||||
}
|
||||
|
||||
// create encounter
|
||||
input.Encounter.Patient_Id = &patientId
|
||||
if resData, err := CreateData(input.Encounter, &event, tx); err != nil {
|
||||
return err
|
||||
} else {
|
||||
data = *resData
|
||||
input.Encounter.Id = data.Id
|
||||
}
|
||||
|
||||
// insert ambulatory/emergency/inpatient
|
||||
err = insertdataClassCode(input.Encounter, recentSoapiDataforCopy, &event, tx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// insert vclaimReference
|
||||
if vr := input.Encounter.VclaimReference; vr != nil {
|
||||
t, _ := time.Parse("2006-01-02", vr.TglRujukan)
|
||||
_, err = uv.CreateData(ev.CreateDto{
|
||||
Encounter_Id: &data.Id,
|
||||
Date: &t,
|
||||
SrcCode: input.Encounter.Ref_Number,
|
||||
SrcName: input.Encounter.RefSource_Name,
|
||||
Number: &vr.NoSep}, &event, tx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
dataEncounter, err := ReadDetailData(e.ReadDetailDto{
|
||||
Id: data.Id,
|
||||
Includes: "Adm_Employee.User,Adm_Employee.Person," +
|
||||
"Patient.Person.Relatives," +
|
||||
"Patient.Person.VclaimMember,VclaimReference," +
|
||||
"Patient.Person.Contacts,Patient.Person.Addresses"},
|
||||
&event, tx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
mwRunner.setMwType(pu.MWTPre)
|
||||
// Run pre-middleware
|
||||
if err := mwRunner.RunCreateWithPatientMiddleware(createWithPatientPreMw, dataEncounter); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
})
|
||||
|
||||
if err = runLogMiddleware(err, input, mwRunner); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
pl.SetLogInfo(&event, nil, "complete")
|
||||
|
||||
return &d.Data{
|
||||
Meta: d.II{
|
||||
"source": source,
|
||||
"structure": "single-data",
|
||||
"status": "created",
|
||||
},
|
||||
Data: data.ToResponse(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ import (
|
||||
epi "simrs-vx/internal/domain/main-entities/prescription-item"
|
||||
er "simrs-vx/internal/domain/main-entities/rehab"
|
||||
es "simrs-vx/internal/domain/main-entities/soapi"
|
||||
eu "simrs-vx/internal/domain/main-entities/unit"
|
||||
esp "simrs-vx/internal/domain/main-entities/specialist"
|
||||
|
||||
ua "simrs-vx/internal/use-case/main-use-case/ambulatory"
|
||||
uc "simrs-vx/internal/use-case/main-use-case/chemo"
|
||||
@@ -66,7 +66,7 @@ func setDataCreate(input *e.CreateDto, data *e.Encounter) {
|
||||
data.Patient_Id = input.Patient_Id
|
||||
data.RegisteredAt = input.RegisteredAt
|
||||
data.Class_Code = input.Class_Code
|
||||
data.Unit_Code = input.Unit_Code
|
||||
data.Specialist_Code = input.Specialist_Code
|
||||
data.Specialist_Code = input.Specialist_Code
|
||||
data.Subspecialist_Code = input.Subspecialist_Code
|
||||
data.VisitDate = input.VisitDate
|
||||
@@ -85,7 +85,7 @@ func setDataCreate(input *e.CreateDto, data *e.Encounter) {
|
||||
}
|
||||
|
||||
func setDataUpdate(src e.UpdateDto, dst *e.Encounter) {
|
||||
dst.Unit_Code = src.Unit_Code
|
||||
dst.Specialist_Code = src.Specialist_Code
|
||||
dst.Specialist_Code = src.Specialist_Code
|
||||
dst.Subspecialist_Code = src.Subspecialist_Code
|
||||
dst.VisitDate = src.VisitDate
|
||||
@@ -101,7 +101,7 @@ func setDataUpdate(src e.UpdateDto, dst *e.Encounter) {
|
||||
func setDataUpdateFromSource(input *e.UpdateDto, data *e.Encounter) {
|
||||
data.Patient_Id = input.Patient_Id
|
||||
data.RegisteredAt = input.RegisteredAt
|
||||
data.Unit_Code = input.Unit_Code
|
||||
data.Specialist_Code = input.Specialist_Code
|
||||
data.Specialist_Code = input.Specialist_Code
|
||||
data.Subspecialist_Code = input.Subspecialist_Code
|
||||
data.VisitDate = input.VisitDate
|
||||
@@ -678,10 +678,10 @@ func insertDataSubClassAmbulatory(input e.CreateDto, soapiData []es.CreateDto, e
|
||||
}
|
||||
|
||||
chemoCreate := ec.CreateDto{
|
||||
Encounter_Id: &input.Id,
|
||||
Status_Code: erc.DVCVerified,
|
||||
SrcUnit_Code: input.Unit_Code,
|
||||
Class_Code: ere.CCCAct,
|
||||
Encounter_Id: &input.Id,
|
||||
Status_Code: erc.DVCVerified,
|
||||
Specialist_Code: input.Specialist_Code,
|
||||
Class_Code: ere.CCCAct,
|
||||
}
|
||||
|
||||
// create data chemo
|
||||
@@ -809,9 +809,9 @@ func setDBError(event *pl.Event, err error, ctx any) error {
|
||||
return pl.SetLogError(event, ctx)
|
||||
}
|
||||
|
||||
func getUnits(unitIds []string, event *pl.Event) ([]eu.Unit, error) {
|
||||
pl.SetLogInfo(event, nil, "started", "getUnits")
|
||||
var units []eu.Unit
|
||||
func getSpecialists(unitIds []string, event *pl.Event) ([]esp.Specialist, error) {
|
||||
pl.SetLogInfo(event, nil, "started", "getSpecialists")
|
||||
var units []esp.Specialist
|
||||
err := dg.I.Where("\"Code\" IN ?", unitIds).Find(&units).Error
|
||||
if err != nil {
|
||||
event.Status = "failed"
|
||||
@@ -841,18 +841,18 @@ func getDoctors(doctorIds []string, event *pl.Event) ([]ed.Doctor, error) {
|
||||
return doctors, nil
|
||||
}
|
||||
|
||||
func validateUnitCodes(unitCodes map[string]struct{}, event *pl.Event) error {
|
||||
if len(unitCodes) > 0 {
|
||||
func validateSpecialistCodes(speCodes map[string]struct{}, event *pl.Event) error {
|
||||
if len(speCodes) > 0 {
|
||||
var codes []string
|
||||
for code := range unitCodes {
|
||||
for code := range speCodes {
|
||||
codes = append(codes, code)
|
||||
}
|
||||
|
||||
units, err := getUnits(codes, event)
|
||||
specialists, err := getSpecialists(codes, event)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to fetch units: %w", err)
|
||||
}
|
||||
if len(units) != len(codes) {
|
||||
if len(specialists) != len(codes) {
|
||||
event.Status = "failed"
|
||||
event.ErrInfo = pl.ErrorInfo{
|
||||
Code: "data-validation-fail",
|
||||
|
||||
@@ -85,8 +85,8 @@ func ReadListData(input e.ReadListDto, event *pl.Event, dbx ...*gorm.DB) ([]e.En
|
||||
tx = tx.Where("\"Encounter\".\"Status_Code\" = ?", *input.Status_Code)
|
||||
}
|
||||
|
||||
if input.Unit_Code != nil {
|
||||
tx = tx.Where("\"Encounter\".\"Unit_Code\" = ?", *input.Unit_Code)
|
||||
if input.Specialist_Code != nil {
|
||||
tx = tx.Where("\"Encounter\".\"Specialist_Code\" = ?", *input.Specialist_Code)
|
||||
}
|
||||
|
||||
if input.PaymentMethod_Code != nil {
|
||||
@@ -280,7 +280,7 @@ func UpdateStatusData(input e.UpdateStatusDto, event *pl.Event, dbx ...*gorm.DB)
|
||||
return nil
|
||||
}
|
||||
|
||||
func UpdateDischargeMethod(input e.SwitchUnitDto, event *pl.Event, dbx ...*gorm.DB) error {
|
||||
func UpdateDischargeMethod(input e.SwitchSpecialistDto, event *pl.Event, dbx ...*gorm.DB) error {
|
||||
pl.SetLogInfo(event, input, "started", "DBUpdateDischargeMethod")
|
||||
dischargeCode := setDischargeMethodCode(*input.PolySwitchCode)
|
||||
|
||||
@@ -394,7 +394,7 @@ func verifyAllocatedVisitCount(i e.CreateDto, event *pl.Event) (e.Encounter, boo
|
||||
return recentEncounterAdm, valid, nil
|
||||
}
|
||||
|
||||
func updateEncounterApproveSwitchUnit(input e.ApproveCancelUnitDto, event *pl.Event, dbx ...*gorm.DB) (err error) {
|
||||
func updateEncounterApproveSwitchSpecialist(input e.ApproveCancelSpecialistDto, event *pl.Event, dbx ...*gorm.DB) (err error) {
|
||||
pl.SetLogInfo(event, nil, "started", "DBCreate")
|
||||
|
||||
var tx *gorm.DB
|
||||
|
||||
@@ -202,7 +202,7 @@ func (me *middlewareRunner) RunUpdateStatusMiddleware(middlewares []updateStatus
|
||||
return nil
|
||||
}
|
||||
|
||||
func (me *middlewareRunner) RunRequestSwitchUnitMiddleware(middleware requestSwitchUnitMw, input *e.Encounter) error {
|
||||
func (me *middlewareRunner) RunRequestSwitchSpecialistMiddleware(middleware requestSwitchSpecialistMw, input *e.Encounter) error {
|
||||
if !me.SyncOn {
|
||||
return nil
|
||||
}
|
||||
@@ -220,7 +220,7 @@ func (me *middlewareRunner) RunRequestSwitchUnitMiddleware(middleware requestSwi
|
||||
return nil
|
||||
}
|
||||
|
||||
func (me *middlewareRunner) RunApproveSwitchUnitMiddleware(middleware approveSwitchUnitMw, input *e.ApproveCancelUnitDto) error {
|
||||
func (me *middlewareRunner) RunApproveSwitchSpecialistMiddleware(middleware approveSwitchSpecialistMw, input *e.ApproveCancelSpecialistDto) error {
|
||||
if !me.SyncOn {
|
||||
return nil
|
||||
}
|
||||
@@ -238,7 +238,7 @@ func (me *middlewareRunner) RunApproveSwitchUnitMiddleware(middleware approveSwi
|
||||
return nil
|
||||
}
|
||||
|
||||
func (me *middlewareRunner) RunCancelSwitchUnitMiddleware(middleware cancelSwitchUnitMw, input *e.ApproveCancelUnitDto) error {
|
||||
func (me *middlewareRunner) RunCancelSwitchSpecialistMiddleware(middleware cancelSwitchSpecialistMw, input *e.ApproveCancelSpecialistDto) error {
|
||||
if !me.SyncOn {
|
||||
return nil
|
||||
}
|
||||
@@ -259,3 +259,22 @@ func (me *middlewareRunner) RunCancelSwitchUnitMiddleware(middleware cancelSwitc
|
||||
func (me *middlewareRunner) setMwType(mwType pu.MWType) {
|
||||
me.MwType = mwType
|
||||
}
|
||||
|
||||
func (me *middlewareRunner) RunCreateWithPatientMiddleware(middlewares []createWithPatientMw, input *e.Encounter) error {
|
||||
if !me.SyncOn {
|
||||
return nil
|
||||
}
|
||||
|
||||
for _, middleware := range middlewares {
|
||||
logData := pu.GetLogData(input, nil)
|
||||
|
||||
pl.SetLogInfo(me.Event, logData, "started", middleware.Name)
|
||||
|
||||
if err := middleware.Func(input); err != nil {
|
||||
return pu.HandleMiddlewareError(me.Event, string(me.MwType), middleware.Name, logData, err)
|
||||
}
|
||||
|
||||
pl.SetLogInfo(me.Event, nil, "complete")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ func init() {
|
||||
updatestatusEncounter = append(updatestatusEncounter,
|
||||
updateStatusMw{Name: "sync-update-status-encounter", Func: plugin.UpdateStatus})
|
||||
|
||||
requestSwitchEncounter = requestSwitchUnitMw{Name: "sync-request-switch-unit-encounter", Func: plugin.RequestSwitchUnit}
|
||||
approveSwitchEncounter = approveSwitchUnitMw{Name: "sync-approve-switch-unit-encounter", Func: plugin.ApproveSwitchUnit}
|
||||
cancelSwitchEncounter = cancelSwitchUnitMw{Name: "sync-cancel-switch-unit-encounter", Func: plugin.CancelSwitchUnit}
|
||||
requestSwitchEncounter = requestSwitchSpecialistMw{Name: "sync-request-switch-unit-encounter", Func: plugin.RequestSwitchSpecialist}
|
||||
approveSwitchEncounter = approveSwitchSpecialistMw{Name: "sync-approve-switch-unit-encounter", Func: plugin.ApproveSwitchSpecialist}
|
||||
cancelSwitchEncounter = cancelSwitchSpecialistMw{Name: "sync-cancel-switch-unit-encounter", Func: plugin.CancelSwitchSpecialist}
|
||||
}
|
||||
|
||||
@@ -59,19 +59,24 @@ type updateStatusMw struct {
|
||||
Func func(input *e.Encounter) error
|
||||
}
|
||||
|
||||
type requestSwitchUnitMw struct {
|
||||
type requestSwitchSpecialistMw struct {
|
||||
Name string
|
||||
Func func(input *e.Encounter) error
|
||||
}
|
||||
|
||||
type approveSwitchUnitMw struct {
|
||||
type approveSwitchSpecialistMw struct {
|
||||
Name string
|
||||
Func func(input *e.ApproveCancelUnitDto) error
|
||||
Func func(input *e.ApproveCancelSpecialistDto) error
|
||||
}
|
||||
|
||||
type cancelSwitchUnitMw struct {
|
||||
type cancelSwitchSpecialistMw struct {
|
||||
Name string
|
||||
Func func(input *e.ApproveCancelUnitDto) error
|
||||
Func func(input *e.ApproveCancelSpecialistDto) error
|
||||
}
|
||||
|
||||
type createWithPatientMw struct {
|
||||
Name string
|
||||
Func func(input *e.Encounter) error
|
||||
}
|
||||
|
||||
type UpdateMw = updateMw
|
||||
@@ -91,6 +96,8 @@ var deletePostMw []readDetailMw
|
||||
var checkinEncounterMw checkinMw
|
||||
var checkoutEncounter checkoutMw
|
||||
var updatestatusEncounter []updateStatusMw
|
||||
var requestSwitchEncounter requestSwitchUnitMw
|
||||
var approveSwitchEncounter approveSwitchUnitMw
|
||||
var cancelSwitchEncounter cancelSwitchUnitMw
|
||||
var requestSwitchEncounter requestSwitchSpecialistMw
|
||||
var approveSwitchEncounter approveSwitchSpecialistMw
|
||||
var cancelSwitchEncounter cancelSwitchSpecialistMw
|
||||
var createWithPatientPreMw []createWithPatientMw
|
||||
var createWithPatientPostMw []createWithPatientMw
|
||||
|
||||
@@ -183,9 +183,9 @@ func generateCL(input GenerateDto, event pl.Event, tx *gorm.DB) (*ResponseDto, e
|
||||
}
|
||||
|
||||
// map template data
|
||||
clData := VclaimControlLetter{}
|
||||
if input.Data != nil {
|
||||
err := json.Unmarshal([]byte(*input.Data), &clData)
|
||||
clData := evscl.ResponseForPDF{}
|
||||
if cl.Value != nil {
|
||||
err := json.Unmarshal([]byte(*cl.Value), &clData)
|
||||
if err != nil {
|
||||
event.ErrInfo = pl.ErrorInfo{
|
||||
Code: "data-unmarshal-fail",
|
||||
@@ -195,22 +195,11 @@ func generateCL(input GenerateDto, event pl.Event, tx *gorm.DB) (*ResponseDto, e
|
||||
return nil, err
|
||||
}
|
||||
} else {
|
||||
return nil, errors.New("there is no data to be used")
|
||||
return nil, errors.New("there is no value to be used")
|
||||
}
|
||||
|
||||
if cl == nil {
|
||||
createCL := evscl.CreateDto{
|
||||
VclaimSep_Number: &clData.VclaimSep.Number,
|
||||
Number: &clData.Number,
|
||||
Value: input.Data,
|
||||
}
|
||||
if cl, err = uvscl.CreateData(createCL, &event, tx); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
}
|
||||
// get encounter id by vclaim sep number
|
||||
vs, err := uvs.ReadDetailData(evs.ReadDetailDto{Number: &clData.VclaimSep.Number}, &event)
|
||||
vs, err := uvs.ReadDetailData(evs.ReadDetailDto{Number: cl.VclaimSep_Number}, &event)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -220,7 +209,7 @@ func generateCL(input GenerateDto, event pl.Event, tx *gorm.DB) (*ResponseDto, e
|
||||
input.Encounter_Id = vs.Encounter_Id
|
||||
input.UseA5Lanscape = true
|
||||
|
||||
templateData := clData.generateTemplateData()
|
||||
templateData := generateTemplateData(clData)
|
||||
// generate file
|
||||
urlPub, err := generateFile(input, templateData)
|
||||
if err != nil {
|
||||
|
||||
@@ -1,15 +1,11 @@
|
||||
package generatefile
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
evscl "simrs-vx/internal/domain/bpjs-entities/vclaim-sep-control-letter"
|
||||
erc "simrs-vx/internal/domain/references/common"
|
||||
ere "simrs-vx/internal/domain/references/encounter"
|
||||
|
||||
er "simrs-vx/internal/domain/main-entities/resume"
|
||||
|
||||
pu "simrs-vx/pkg/use-case-helper"
|
||||
)
|
||||
|
||||
type GeneralConsentPDF struct {
|
||||
@@ -105,28 +101,6 @@ type GenerateDto struct {
|
||||
Data *string `json:"data"`
|
||||
}
|
||||
|
||||
type VclaimControlLetter struct {
|
||||
Number string `json:"noSuratKontrol"`
|
||||
PlannedControlDate string `json:"tglRencanaKontrol"`
|
||||
Doctor_Name string `json:"namaDokter"`
|
||||
DstUnit_Name string `json:"namaPoliTujuan"`
|
||||
ResponsibleDoctor_Name string `json:"namaDokterPembuat"`
|
||||
VclaimSep VclaimSep `json:"sep"`
|
||||
}
|
||||
|
||||
type VclaimSep struct {
|
||||
VclaimMember VclaimMember `json:"peserta"`
|
||||
Diagnose string `json:"diagnosa"`
|
||||
Number string `json:"noSep"`
|
||||
}
|
||||
|
||||
type VclaimMember struct {
|
||||
CardNumber string `json:"noKartu"`
|
||||
Name string `json:"nama"`
|
||||
BirthDate string `json:"tglLahir"`
|
||||
Gender string `json:"kelamin"`
|
||||
}
|
||||
|
||||
type GeneratePDFdto struct {
|
||||
TemplatePath string
|
||||
TemplateData any
|
||||
@@ -149,37 +123,17 @@ const (
|
||||
TDNSB TemplateDocsName = "screening-form-b.html"
|
||||
)
|
||||
|
||||
func (v VclaimControlLetter) generateTemplateData() ControlLetterPDF {
|
||||
|
||||
func generateTemplateData(v evscl.ResponseForPDF) ControlLetterPDF {
|
||||
return ControlLetterPDF{
|
||||
Number: v.Number,
|
||||
Doctor_Name: v.Doctor_Name,
|
||||
DstUnit_Name: v.DstUnit_Name,
|
||||
CardNumber: v.VclaimSep.VclaimMember.CardNumber,
|
||||
Name: v.generateNameWithGender(),
|
||||
BirthDate: v.generateBirthDate(),
|
||||
Name: v.GenerateNameWithGender(),
|
||||
BirthDate: v.GenerateBirthDate(),
|
||||
Diagnose: v.VclaimSep.Diagnose,
|
||||
PlanDate: v.PlannedControlDate,
|
||||
ResponsibleDoctor_Name: v.ResponsibleDoctor_Name,
|
||||
PrintDate: generatePrintDate(),
|
||||
PrintDate: v.IssuedDate,
|
||||
}
|
||||
}
|
||||
|
||||
func (v VclaimControlLetter) generateNameWithGender() string {
|
||||
gender := "Perempuan"
|
||||
if v.VclaimSep.VclaimMember.Gender == "L" {
|
||||
gender = "Laki-Laki"
|
||||
}
|
||||
|
||||
return fmt.Sprintf("%s (%s)", v.VclaimSep.VclaimMember.Name, gender)
|
||||
}
|
||||
|
||||
func (v VclaimControlLetter) generateBirthDate() string {
|
||||
t, _ := time.Parse("2006-01-02", v.VclaimSep.VclaimMember.BirthDate)
|
||||
return pu.FormatIndonesianDate(t)
|
||||
}
|
||||
|
||||
func generatePrintDate() string {
|
||||
now := time.Now()
|
||||
return now.Format("2006/01/02")
|
||||
}
|
||||
|
||||
@@ -57,7 +57,6 @@ func createProcedureRoom(input *e.CreateDto, event *pl.Event, tx *gorm.DB) error
|
||||
roomCreate := er.CreateDto{
|
||||
Code: input.Infra_Code,
|
||||
Infra_Code: input.Infra_Code,
|
||||
Unit_Code: input.Unit_Code,
|
||||
Specialist_Code: input.Specialist_Code,
|
||||
Subspecialist_Code: input.Subspecialist_Code,
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user