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:
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user