add encounter-checkin
This commit is contained in:
@@ -10,9 +10,9 @@ import (
|
||||
rw "github.com/karincake/risoles"
|
||||
)
|
||||
|
||||
func validateRequestCheckout(w http.ResponseWriter, i e.DischargeDto) (valid bool) {
|
||||
const dataValidationFail = ""
|
||||
const dataValidationFail = "data-validation-fail"
|
||||
|
||||
func validateRequestCheckout(w http.ResponseWriter, i e.DischargeDto) (valid bool) {
|
||||
switch *i.Discharge_Method_Code {
|
||||
case ere.DMCDeath:
|
||||
if i.DeathCause == nil {
|
||||
@@ -51,3 +51,15 @@ func validateRequestCheckout(w http.ResponseWriter, i e.DischargeDto) (valid boo
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func validateRequestCheckIn(w http.ResponseWriter, i e.CheckinDto) (valid bool) {
|
||||
if i.Responsible_Doctor_Id == nil && i.Adm_Employee_Id == nil {
|
||||
rw.DataResponse(w, nil, d.FieldError{
|
||||
Code: dataValidationFail,
|
||||
Message: "responsible_doctor_id or adm_employee_id required",
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user