Merge branch 'migration' into feat/mcu-order
This commit is contained in:
No files matched your search
@@ -0,0 +1,2 @@
|
|||||||
|
-- Modify "ActionReport" table
|
||||||
|
ALTER TABLE "public"."ActionReport" DROP COLUMN "Date", DROP COLUMN "Procedures";
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
-- Modify "ActionReport" table
|
||||||
|
ALTER TABLE "public"."ActionReport" ADD COLUMN "Date" timestamptz NOT NULL;
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
-- Modify "ActionReport" table
|
||||||
|
ALTER TABLE "public"."ActionReport" ADD CONSTRAINT "fk_ActionReport_Instrumentor_Employe" FOREIGN KEY ("Instrumentor_Employe_Id") REFERENCES "public"."Employee" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION, ADD CONSTRAINT "fk_ActionReport_Nurse" FOREIGN KEY ("Nurse_Code") REFERENCES "public"."Nurse" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION, ADD CONSTRAINT "fk_ActionReport_Operator_Employe" FOREIGN KEY ("Operator_Employe_Id") REFERENCES "public"."Employee" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION;
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
-- Modify "ActionReport" table
|
||||||
|
ALTER TABLE "public"."ActionReport" ADD CONSTRAINT "fk_ActionReport_Doctor" FOREIGN KEY ("Doctor_Code") REFERENCES "public"."Doctor" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION;
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
-- Modify "Screening" table
|
||||||
|
ALTER TABLE "public"."Screening" ADD COLUMN "Status" text NULL, ADD COLUMN "FileUrl" character varying(1024) NULL;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
h1:NUsCmkoiBso9yZsv4HWrn3+woqMcFRFtgXKln5rY4pQ=
|
h1:bYhAmgY4p8jgE8JpZ6YeJyS1iYCH2LEvDXW2PE+iZpc=
|
||||||
20250904105930.sql h1:MEM6blCgke9DzWQSTnLzasbPIrcHssNNrJqZpSkEo6k=
|
20250904105930.sql h1:MEM6blCgke9DzWQSTnLzasbPIrcHssNNrJqZpSkEo6k=
|
||||||
20250904141448.sql h1:J8cmYNk4ZrG9fhfbi2Z1IWz7YkfvhFqTzrLFo58BPY0=
|
20250904141448.sql h1:J8cmYNk4ZrG9fhfbi2Z1IWz7YkfvhFqTzrLFo58BPY0=
|
||||||
20250908062237.sql h1:Pu23yEW/aKkwozHoOuROvHS/GK4ngARJGdO7FB7HZuI=
|
20250908062237.sql h1:Pu23yEW/aKkwozHoOuROvHS/GK4ngARJGdO7FB7HZuI=
|
||||||
@@ -133,3 +133,7 @@ h1:NUsCmkoiBso9yZsv4HWrn3+woqMcFRFtgXKln5rY4pQ=
|
|||||||
20251126064057.sql h1:vAdhz5Nn/gGJy0UKZAEldeXv8HpHtJU/t8ygDVIbTsU=
|
20251126064057.sql h1:vAdhz5Nn/gGJy0UKZAEldeXv8HpHtJU/t8ygDVIbTsU=
|
||||||
20251201081333.sql h1:PoC8ADRdwDuohDTB74yW/DaB42igdYa4B6humbrEJBk=
|
20251201081333.sql h1:PoC8ADRdwDuohDTB74yW/DaB42igdYa4B6humbrEJBk=
|
||||||
20251201104439.sql h1:tpqdrOf9d2aGwZshqm62nG6SXnfVaO/g6A7z0efPS14=
|
20251201104439.sql h1:tpqdrOf9d2aGwZshqm62nG6SXnfVaO/g6A7z0efPS14=
|
||||||
|
20251201113804.sql h1:kIEmVoETJXBkab2Q+b3y/pP84eF8W2BdQ47amHCnc+c=
|
||||||
|
20251201113858.sql h1:KLXKZO5XTQPoEU0YLHE8Fhg9WPKpSN3wNgYPJ+RGFcg=
|
||||||
|
20251201114751.sql h1:QMcFLz4vr6lwQ03k0Wthhosce743DW9A3w6WJzfqjoU=
|
||||||
|
20251201114913.sql h1:GvRLyn62Z5CIckonFhtHOZKbJK43yyoCXUfFiADLiAo=
|
||||||
@@ -3,20 +3,21 @@ package actionreport
|
|||||||
import (
|
import (
|
||||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||||
ee "simrs-vx/internal/domain/main-entities/encounter"
|
ee "simrs-vx/internal/domain/main-entities/encounter"
|
||||||
|
"time"
|
||||||
|
|
||||||
pa "simrs-vx/internal/lib/auth"
|
pa "simrs-vx/internal/lib/auth"
|
||||||
)
|
)
|
||||||
|
|
||||||
type CreateDto struct {
|
type CreateDto struct {
|
||||||
Encounter_Id uint64 `json:"encounter_id"`
|
Encounter_Id uint64 `json:"encounter_id" validate:"required"`
|
||||||
Date string `json:"date"`
|
Date *time.Time `json:"date" validate:"required"`
|
||||||
Doctor_Code string `json:"doctor_code"`
|
Doctor_Code string `json:"doctor_code" validate:"required"`
|
||||||
Operator_Employe_Id *uint `json:"operator_employe_id"`
|
Operator_Employe_Id uint `json:"operator_employe_id" validate:"required"`
|
||||||
Assistant_Employe_Id *uint `json:"assistant_employe_id"`
|
Assistant_Employe_Id uint `json:"assistant_employe_id" validate:"required"`
|
||||||
Instrumentor_Employe_Id *uint `json:"instrumentor_employe_id"`
|
Instrumentor_Employe_Id uint `json:"instrumentor_employe_id" validate:"required"`
|
||||||
Diagnose *string `json:"diagnose"`
|
Diagnose *string `json:"diagnose"`
|
||||||
Nurse_Code *string `json:"nurse_code"`
|
Nurse_Code string `json:"nurse_code" validate:"required"`
|
||||||
Value string `json:"value"`
|
Value string `json:"value" validate:"required"`
|
||||||
|
|
||||||
pa.AuthInfo
|
pa.AuthInfo
|
||||||
}
|
}
|
||||||
@@ -54,13 +55,13 @@ type ResponseDto struct {
|
|||||||
ecore.Main
|
ecore.Main
|
||||||
Encounter_Id uint64 `json:"encounter_id"`
|
Encounter_Id uint64 `json:"encounter_id"`
|
||||||
Encounter *ee.Encounter `json:"encounter,omitempty"`
|
Encounter *ee.Encounter `json:"encounter,omitempty"`
|
||||||
Date string `json:"date"`
|
Date *time.Time `json:"date"`
|
||||||
Doctor_Code string `json:"doctor_code"`
|
Doctor_Code string `json:"doctor_code"`
|
||||||
Operator_Employe_Id *uint `json:"operator_employe_id"`
|
Operator_Employe_Id uint `json:"operator_employe_id"`
|
||||||
Assistant_Employe_Id *uint `json:"assistant_employe_id"`
|
Assistant_Employe_Id uint `json:"assistant_employe_id"`
|
||||||
Instrumentor_Employe_Id *uint `json:"instrumentor_employe_id"`
|
Instrumentor_Employe_Id uint `json:"instrumentor_employe_id"`
|
||||||
Diagnose *string `json:"diagnose"`
|
Diagnose *string `json:"diagnose"`
|
||||||
Nurse_Code *string `json:"nurse_code"`
|
Nurse_Code string `json:"nurse_code"`
|
||||||
Value *string `json:"value"`
|
Value *string `json:"value"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,23 +2,29 @@ package actionreport
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
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"
|
ee "simrs-vx/internal/domain/main-entities/encounter"
|
||||||
|
en "simrs-vx/internal/domain/main-entities/nurse"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ActionReport struct {
|
type ActionReport struct {
|
||||||
ecore.Main // adjust this according to the needs
|
ecore.Main // adjust this according to the needs
|
||||||
Encounter_Id uint64 `json:"encounter_id" gorm:"foreignKey"`
|
Encounter_Id uint64 `json:"encounter_id" gorm:"foreignKey"`
|
||||||
Encounter *ee.Encounter `json:"doctor,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
|
Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
|
||||||
Date string `json:"date" gorm:"not null;size:20"`
|
Date *time.Time `json:"date" gorm:"not null;size:20"`
|
||||||
Doctor_Code string `json:"doctor_code" gorm:"size:10"`
|
Doctor_Code string `json:"doctor_code" gorm:"size:10"`
|
||||||
Operator_Employe_Id *uint `json:"operator_employe_id"`
|
Doctor *ed.Doctor `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Code;references:Code"`
|
||||||
Assistant_Employe_Id *uint `json:"assistant_employe_id"`
|
Operator_Employe_Id uint `json:"operator_employe_id"`
|
||||||
Instrumentor_Employe_Id *uint `json:"instrumentor_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"`
|
Diagnose *string `json:"diagnose" gorm:"size:1024"`
|
||||||
Procedures *string `json:"procedures" gorm:"size:10240"`
|
Nurse_Code string `json:"nurse_code" gorm:"size:10"`
|
||||||
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"`
|
||||||
Value string `json:"value"`
|
|
||||||
// SurgerySize_Code *string `json:"surgerySize_code" gorm:"size:10"`
|
// SurgerySize_Code *string `json:"surgerySize_code" gorm:"size:10"`
|
||||||
// Billing_Code *string `json:"billing_code" gorm:"size:10"`
|
// Billing_Code *string `json:"billing_code" gorm:"size:10"`
|
||||||
// SurgerySystem_Code *string `json:"surgerySystem_code" gorm:"size:10"`
|
// SurgerySystem_Code *string `json:"surgerySystem_code" gorm:"size:10"`
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ type ReadDetailDto struct {
|
|||||||
Employee_Id *uint `json:"employee_id"`
|
Employee_Id *uint `json:"employee_id"`
|
||||||
IHS_Number *string `json:"ihs_number"`
|
IHS_Number *string `json:"ihs_number"`
|
||||||
SIP_Number *string `json:"sip_number"`
|
SIP_Number *string `json:"sip_number"`
|
||||||
|
Includes string `json:"includes"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type UpdateDto struct {
|
type UpdateDto struct {
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package mcuordersubitem
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||||
emss "simrs-vx/internal/domain/main-entities/mcu-sub-src"
|
|
||||||
|
|
||||||
erc "simrs-vx/internal/domain/references/common"
|
erc "simrs-vx/internal/domain/references/common"
|
||||||
)
|
)
|
||||||
@@ -10,7 +9,6 @@ import (
|
|||||||
type McuOrderSubItem struct {
|
type McuOrderSubItem struct {
|
||||||
ecore.Main // adjust this according to the needs
|
ecore.Main // adjust this according to the needs
|
||||||
McuSubSrc_Code *string `json:"mcuSubSrc_code" gorm:"uniqueIndex:idx_order_sub_src"`
|
McuSubSrc_Code *string `json:"mcuSubSrc_code" gorm:"uniqueIndex:idx_order_sub_src"`
|
||||||
McuSubSrc *emss.McuSubSrc `json:"mcuSubSrc,omitempty" gorm:"foreignKey:McuSubSrc_Code;references:Code"`
|
|
||||||
McuOrderItem_Id *uint `json:"mcuOrderItem_id" gorm:"uniqueIndex:idx_order_sub_src"`
|
McuOrderItem_Id *uint `json:"mcuOrderItem_id" gorm:"uniqueIndex:idx_order_sub_src"`
|
||||||
Result *string `json:"result"`
|
Result *string `json:"result"`
|
||||||
Status_Code erc.DataStatusCode `json:"status_code"`
|
Status_Code erc.DataStatusCode `json:"status_code"`
|
||||||
|
|||||||
@@ -3,15 +3,17 @@ package mcuordersubitem
|
|||||||
import (
|
import (
|
||||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||||
emoi "simrs-vx/internal/domain/main-entities/mcu-order-item"
|
emoi "simrs-vx/internal/domain/main-entities/mcu-order-item"
|
||||||
|
emss "simrs-vx/internal/domain/main-entities/mcu-sub-src"
|
||||||
|
|
||||||
eb "simrs-vx/internal/domain/main-entities/mcu-order-sub-item/base"
|
emosi "simrs-vx/internal/domain/main-entities/mcu-order-sub-item/base"
|
||||||
erc "simrs-vx/internal/domain/references/common"
|
erc "simrs-vx/internal/domain/references/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
type McuOrderSubItem struct {
|
type McuOrderSubItem struct {
|
||||||
ecore.Main // adjust this according to the needs
|
ecore.Main // adjust this according to the needs
|
||||||
eb.McuOrderSubItem
|
McuSubSrc *emss.McuSubSrc `json:"mcuSubSrc,omitempty" gorm:"foreignKey:McuSubSrc_Code;references:Code"`
|
||||||
McuOrderItem *emoi.McuOrderItem `json:"mcuOrderItem,omitempty" gorm:"foreignKey:McuOrderItem_Id;references:Id"`
|
McuOrderItem *emoi.McuOrderItem `json:"mcuOrderItem,omitempty" gorm:"foreignKey:McuOrderItem_Id;references:Id"`
|
||||||
|
emosi.McuOrderSubItem
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d McuOrderSubItem) IsCompleted() bool {
|
func (d McuOrderSubItem) IsCompleted() bool {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import (
|
|||||||
eem "simrs-vx/internal/domain/main-entities/employee"
|
eem "simrs-vx/internal/domain/main-entities/employee"
|
||||||
|
|
||||||
erc "simrs-vx/internal/domain/references/clinical"
|
erc "simrs-vx/internal/domain/references/clinical"
|
||||||
|
erco "simrs-vx/internal/domain/references/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Screening struct {
|
type Screening struct {
|
||||||
@@ -13,5 +14,7 @@ type Screening struct {
|
|||||||
Employee_Id *uint `json:"employee_id"`
|
Employee_Id *uint `json:"employee_id"`
|
||||||
Employee *eem.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"`
|
Employee *eem.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"`
|
||||||
Type erc.ScreeningFormTypeCode `json:"type"`
|
Type erc.ScreeningFormTypeCode `json:"type"`
|
||||||
|
Status erco.DataVerifiedCode `json:"status"`
|
||||||
Value *string `json:"value"`
|
Value *string `json:"value"`
|
||||||
|
FileUrl *string `json:"fileUrl" gorm:"size:1024"`
|
||||||
}
|
}
|
||||||
@@ -25,6 +25,7 @@ const (
|
|||||||
EPCLab EmployeePositionCode = "lab" // Laboran
|
EPCLab EmployeePositionCode = "lab" // Laboran
|
||||||
EPCPha EmployeePositionCode = "pha" // Farmasi
|
EPCPha EmployeePositionCode = "pha" // Farmasi
|
||||||
EPCNom EmployeePositionCode = "nom" // Non Medic
|
EPCNom EmployeePositionCode = "nom" // Non Medic
|
||||||
|
EPCScr EmployeePositionCode = "scr" // Screening MPP
|
||||||
// EPCPay EmployeePositionCode = "pay" // Pembayaran
|
// EPCPay EmployeePositionCode = "pay" // Pembayaran
|
||||||
// EPCHur EmployeePositionCode = "hue" // Sumber Daya Manusia
|
// EPCHur EmployeePositionCode = "hue" // Sumber Daya Manusia
|
||||||
// EPCGea EmployeePositionCode = "gea" // Bagian Umum
|
// EPCGea EmployeePositionCode = "gea" // Bagian Umum
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ func (obj myBase) GetDetail(w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
dto := e.ReadDetailDto{}
|
dto := e.ReadDetailDto{}
|
||||||
|
sf.UrlQueryParam(&dto, *r.URL)
|
||||||
dto.Code = &code
|
dto.Code = &code
|
||||||
res, err := u.ReadDetail(dto)
|
res, err := u.ReadDetail(dto)
|
||||||
rw.DataResponse(w, res, err)
|
rw.DataResponse(w, res, err)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package doctor
|
package doctor
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
e "simrs-vx/internal/domain/main-entities/doctor"
|
e "simrs-vx/internal/domain/main-entities/doctor"
|
||||||
|
|
||||||
plh "simrs-vx/pkg/lib-helper"
|
plh "simrs-vx/pkg/lib-helper"
|
||||||
@@ -90,7 +91,8 @@ func ReadDetailData(input e.ReadDetailDto, event *pl.Event, dbx ...*gorm.DB) (*e
|
|||||||
if input.Code != nil {
|
if input.Code != nil {
|
||||||
tx = tx.Where("\"Code\" = ?", input.Code)
|
tx = tx.Where("\"Code\" = ?", input.Code)
|
||||||
}
|
}
|
||||||
if err := tx.First(&data).Error; err != nil {
|
fmt.Println(input.Includes)
|
||||||
|
if err := tx.Scopes(gh.Preload(input.Includes)).First(&data).Error; err != nil {
|
||||||
if processedErr := pu.HandleReadError(err, event, source, input.Id, data); processedErr != nil {
|
if processedErr := pu.HandleReadError(err, event, source, input.Id, data); processedErr != nil {
|
||||||
return nil, processedErr
|
return nil, processedErr
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user