step 10 : proses add data dokter

This commit is contained in:
sindhu
2024-06-05 09:35:14 +07:00
parent 7819a0f900
commit 61e62d4726
8 changed files with 2193 additions and 216 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -298,4 +298,5 @@ func SetupRoutesDev(app *echo.Echo, appStore db.AppStore) {
dev.GET("/md/doctorv2", devMdDChandlers.HandleShowMdDoctorScreen)
dev.GET("/md/doctorv2/filter", devMdDChandlers.HandleFilterMdDoctor)
dev.GET("/md/doctorv2/changepage", devMdDChandlers.HandleChangePageMdDoctor)
dev.POST("/md/doctorv2/add", devMdDChandlers.HandleAddMdDoctor)
}

View File

@@ -9,6 +9,7 @@ import (
type DoctorV1 struct {
Nomor string `db:"nomor"`
M_DoctorID int `db:"M_DoctorID"`
M_DoctorM_TitleID int `db:"M_DoctorM_TitleID"`
M_DoctorCode string `db:"M_DoctorCode"`
M_DoctorPrefix string `db:"M_DoctorPrefix"`
M_DoctorPrefix2 string `db:"M_DoctorPrefix2"`
@@ -28,6 +29,8 @@ type DoctorV1 struct {
M_DoctorCitizenship string `db:"M_DoctorCitizenship"`
M_DoctorEtnicCode string `db:"M_DoctorEtnicCode"`
M_DoctorEtnicSystem string `db:"M_DoctorEtnicSystem"`
M_DoctorIdentifierCode string `db:"M_DoctorIdentifierCode"`
M_DoctorIdentifierSystem string `db:"M_DoctorIdentifierSystem"`
M_DoctorIdentifierValue string `db:"M_DoctorIdentifierValue"`
M_DoctorHp string `db:"M_DoctorHp"`
M_DoctorEmail string `db:"M_DoctorEmail"`
@@ -47,6 +50,7 @@ type DoctorV1 struct {
M_DoctorLastUpdatedUserID string `db:"M_DoctorLastUpdatedUserID"`
M_DoctorDeletedUserID string `db:"M_DoctorDeletedUserID"`
M_DoctorDeleted string `db:"M_DoctorDeleted"`
M_DoctorIsActive string `db:"M_DoctorIsActive"`
}
// title
@@ -77,7 +81,7 @@ type SpecialistV0 struct {
}
// hardcode dropdown(jenis kelamin)
type HardCodeDropdownV0 struct {
type HardCodeDropdownJKV0 struct {
ID int `json:"ID"`
Text string `json:"Text"`
}

View File

@@ -6,6 +6,7 @@ import (
dbx "cpone/package/database"
"fmt"
"math"
"strconv"
"strings"
"go.uber.org/zap"
@@ -633,8 +634,8 @@ func (su *ServicesMdDoctor) GetListMdSapaan() ([]models.TitleSapaan, error) {
}
// jenis kelamin
func (su *ServicesMdDoctor) GetJenisKelamin() ([]models.HardCodeDropdownV0, error) {
data := []models.HardCodeDropdownV0{
func (su *ServicesMdDoctor) GetJenisKelamin() ([]models.HardCodeDropdownJKV0, error) {
data := []models.HardCodeDropdownJKV0{
{
ID: 1,
Text: "male",
@@ -758,6 +759,7 @@ func (su *ServicesMdDoctor) GetListMdDoctor(search string, currentPage int, rowP
SELECT
ROW_NUMBER() OVER () AS nomor,
d.M_DoctorID,
d.M_DoctorM_TitleID,
ifnull(d.M_DoctorCode,'') as M_DoctorCode,
ifnull(d.M_DoctorPrefix,'') as M_DoctorPrefix,
ifnull(d.M_DoctorPrefix2,'') as M_DoctorPrefix2,
@@ -787,12 +789,14 @@ func (su *ServicesMdDoctor) GetListMdDoctor(search string, currentPage int, rowP
d.M_DoctorCitizenship,
d.M_DoctorEtnicCode,
d.M_DoctorEtnicSystem,
d.M_DoctorIdentifierCode,
d.M_DoctorIdentifierSystem,
d.M_DoctorIdentifierValue,
d.M_DoctorHp,
d.M_DoctorEmail,
d.M_DoctorM_SpecialistID,
spesialis.M_SpecialistID,
spesialis.M_SpecialistName,
IFNULL(spesialis.M_SpecialistID, 0) as M_SpecialistID,
IFNULL(spesialis.M_SpecialistName, '') as M_SpecialistName,
IFNULL(d.M_DoctorAddress, '') as M_DoctorAddress,
IFNULL(title.M_TitleName, '') as M_TitleName,
d.M_DoctorCreated,
@@ -800,7 +804,8 @@ func (su *ServicesMdDoctor) GetListMdDoctor(search string, currentPage int, rowP
d.M_DoctorLastUpdated,
d.M_DoctorLastUpdatedUserID,
d.M_DoctorDeletedUserID,
d.M_DoctorDeleted
d.M_DoctorDeleted,
d.M_DoctorIsActive
FROM m_doctor as d
-- join m_title
LEFT JOIN m_title as title
@@ -836,3 +841,396 @@ func (su *ServicesMdDoctor) GetListMdDoctor(search string, currentPage int, rowP
return doctorList, totalPage, nil
}
// Get Doctor Code
func (su *ServicesMdDoctor) GetMdDoctorCode(tipe string) (string, error) {
var doctorCode string
logger, _ := zap.NewProduction()
defer logger.Sync()
query := `
select fn_numbering(?) as doctorCode
`
logger.Info("QUERY DOCTOR CODE",
zap.String("query search", query),
)
if err := dbx.Handlex.Get(&doctorCode, query,
tipe,
); err != nil {
return "", fmt.Errorf("error querying database: %v", err)
}
return doctorCode, nil
}
// GET BY ID
func (ug *ServicesMdDoctor) GetMdDoctorByID(id string) (models.DoctorV1, error) {
logger, _ := zap.NewProduction()
var data models.DoctorV1
err := dbx.Handlex.Get(&data, `SELECT
ROW_NUMBER() OVER () AS nomor,
d.M_DoctorID,
d.M_DoctorM_TitleID,
ifnull(d.M_DoctorCode,'') as M_DoctorCode,
ifnull(d.M_DoctorPrefix,'') as M_DoctorPrefix,
ifnull(d.M_DoctorPrefix2,'') as M_DoctorPrefix2,
CONCAT(
IFNULL(d.M_DoctorPrefix, ''),
' ',
IFNULL(d.M_DoctorPrefix2, ''),
' ',
IFNULL(d.M_DoctorName, ''),
' ',
IFNULL(d.M_DoctorSuffix, ''),
' ',
IFNULL(d.M_DoctorSuffix2, '')
) as M_DoctorName,
ifnull(d.M_DoctorSuffix,'') as M_DoctorSuffix,
ifnull(d.M_DoctorSuffix2,'') as M_DoctorSuffix2,
d.M_DoctorGender,
d.M_DoctorDOB,
d.M_DoctorReligionCode,
d.M_DoctorReligionSystem,
d.M_DoctorBloodTypeCode,
d.M_DoctorBloodTypeSystem,
d.M_DoctorBloodRhCode,
d.M_DoctorBloodRhSystem,
d.M_DoctorEducationCode,
d.M_DoctorEducationSystem,
d.M_DoctorCitizenship,
d.M_DoctorEtnicCode,
d.M_DoctorEtnicSystem,
d.M_DoctorIdentifierCode,
d.M_DoctorIdentifierSystem,
d.M_DoctorIdentifierValue,
d.M_DoctorHp,
d.M_DoctorEmail,
d.M_DoctorM_SpecialistID,
IFNULL(spesialis.M_SpecialistID, 0) as M_SpecialistID,
IFNULL(spesialis.M_SpecialistName, '') as M_SpecialistName,
IFNULL(d.M_DoctorAddress, '') as M_DoctorAddress,
IFNULL(title.M_TitleName, '') as M_TitleName,
d.M_DoctorCreated,
d.M_DoctorCreatedUserID,
d.M_DoctorLastUpdated,
d.M_DoctorLastUpdatedUserID,
d.M_DoctorDeletedUserID,
d.M_DoctorDeleted,
d.M_DoctorIsActive
FROM m_doctor as d
-- join m_title
LEFT JOIN m_title as title
ON d.M_DoctorM_TitleID = title.M_TitleID
AND title.M_TitleIsActive = 'Y'
-- join m_specialist
LEFT JOIN m_specialist as spesialis
ON d.M_DoctorM_SpecialistID = spesialis.M_SpecialistID
AND spesialis.M_SpecialistIsActive = 'Y'
WHERE d.M_DoctorIsActive = 'Y' AND
d.M_DoctorID = ?`, id)
if err != nil {
defer logger.Sync()
logger.Error("Error get data gr by id vs",
zap.String("ID", id),
zap.Error(err),
)
return data, fmt.Errorf("QUERY_FAILED")
}
return data, nil
}
// PROSES ADD DOCTOR
func (su *ServicesMdDoctor) AddMdDoctor(inp models.DoctorV1) (models.DoctorV1, error) {
logger, _ := zap.NewProduction()
var data models.DoctorV1
var datacek []models.DoctorV1
defer logger.Sync()
logger.Error("VALUE YANG DI ADD",
zap.Any("INPUTAN VALUE", inp),
)
prm := "%" + strings.TrimSpace(inp.M_DoctorName) + "%"
qryCek := `SELECT M_DoctorName
FROM m_doctor
WHERE M_DoctorName LIKE ?
AND M_DoctorIsActive = 'Y'`
err := dbx.Handlex.Select(&datacek, qryCek, prm)
if err != nil {
defer logger.Sync()
logger.Error("Error cek data by doctorname",
zap.String("doctorname", inp.M_DoctorName),
zap.Any("datacek", datacek),
)
return data, fmt.Errorf("QUERY_FAILED")
}
if len(datacek) > 0 {
defer logger.Sync()
logger.Error("Doctor Name already taken by another data",
zap.String("doctorname", inp.M_DoctorName),
)
return data, fmt.Errorf("doctor Name sudah dipakai")
}
// VARIABLE START
M_DoctorM_TitleID := 0
M_DoctorCode := ""
M_DoctorPrefix := ""
M_DoctorPrefix2 := ""
M_DoctorName := inp.M_DoctorName
M_DoctorSuffix := ""
M_DoctorSuffix2 := ""
M_DoctorGender := inp.M_DoctorGender
M_DoctorDOB := "0000-00-00 00:00:00"
M_DoctorReligionCode := ""
M_DoctorReligionSystem := ""
M_DoctorBloodTypeCode := ""
M_DoctorBloodTypeSystem := ""
M_DoctorBloodRhCode := ""
M_DoctorBloodRhSystem := ""
M_DoctorEducationCode := ""
M_DoctorEducationSystem := ""
M_DoctorCitizenship := inp.M_DoctorCitizenship
M_DoctorEtnicCode := ""
M_DoctorEtnicSystem := ""
M_DoctorIdentifierCode := ""
M_DoctorIdentifierSystem := ""
M_DoctorIdentifierValue := inp.M_DoctorIdentifierValue
M_DoctorHp := ""
M_DoctorEmail := ""
M_DoctorS_SpecialistID := 0
M_DoctorAddress := ""
M_DoctorAddressRegionalCd := 0
M_DoctorAddressCity := ""
M_DoctorAddressDistrict := ""
M_DoctorAddressState := ""
M_DoctorAddressCountry := ""
// VARIABLE END
// CHECK PARAMS
if inp.M_DoctorM_TitleID != 0 {
M_DoctorM_TitleID = inp.M_DoctorM_TitleID
}
if inp.M_DoctorCode != "" {
M_DoctorCode = inp.M_DoctorCode
}
if inp.M_DoctorPrefix != "" {
M_DoctorPrefix = inp.M_DoctorPrefix
}
if inp.M_DoctorPrefix2 != "" {
M_DoctorPrefix2 = inp.M_DoctorPrefix2
}
if inp.M_DoctorSuffix != "" {
M_DoctorSuffix = inp.M_DoctorSuffix
}
if inp.M_DoctorSuffix2 != "" {
M_DoctorSuffix2 = inp.M_DoctorSuffix2
}
if inp.M_DoctorDOB != "" {
M_DoctorDOB = inp.M_DoctorDOB
}
if inp.M_DoctorReligionCode != "default" {
M_DoctorReligionCode = inp.M_DoctorReligionCode
M_DoctorReligionSystem = inp.M_DoctorReligionSystem
}
if inp.M_DoctorBloodTypeCode != "default" {
M_DoctorBloodTypeCode = inp.M_DoctorBloodTypeCode
M_DoctorBloodTypeSystem = inp.M_DoctorBloodTypeSystem
}
if inp.M_DoctorBloodRhCode != "default" {
M_DoctorBloodRhCode = inp.M_DoctorBloodRhCode
M_DoctorBloodRhSystem = inp.M_DoctorBloodRhSystem
}
if inp.M_DoctorEducationCode != "default" {
M_DoctorEducationCode = inp.M_DoctorEducationCode
M_DoctorEducationSystem = inp.M_DoctorEducationSystem
}
if inp.M_DoctorEtnicCode != "default" {
M_DoctorEtnicCode = inp.M_DoctorEtnicCode
M_DoctorEtnicSystem = inp.M_DoctorEtnicSystem
}
if inp.M_DoctorIdentifierCode != "default" {
M_DoctorIdentifierCode = inp.M_DoctorIdentifierCode
M_DoctorIdentifierSystem = inp.M_DoctorIdentifierSystem
}
if inp.M_DoctorHp != "" {
M_DoctorHp = inp.M_DoctorHp
}
if inp.M_DoctorEmail != "" {
M_DoctorEmail = inp.M_DoctorEmail
}
if inp.M_DoctorM_SpecialistID != "0" {
M_DoctorS_SpecialistID, err = strconv.Atoi(inp.M_DoctorM_SpecialistID)
if err != nil {
defer logger.Sync()
logger.Error("Error CONVERT DOCTOR SPECIALIS",
zap.Any("M_SpecialistID", M_DoctorS_SpecialistID),
)
return data, fmt.Errorf("error CONVERT DOCTOR SPECIALIS")
}
}
if inp.M_DoctorAddressRegionalCd != 0 {
M_DoctorAddressRegionalCd = inp.M_DoctorAddressRegionalCd
M_DoctorAddress = inp.M_DoctorAddress
M_DoctorAddressCity = inp.M_DoctorAddressCity
M_DoctorAddressDistrict = inp.M_DoctorAddressDistrict
M_DoctorAddressState = inp.M_DoctorAddressState
M_DoctorAddressCountry = inp.M_DoctorAddressCountry
}
// CHECK PARAMS
query := `INSERT INTO m_doctor
(
M_DoctorM_TitleID,
M_DoctorCode,
M_DoctorPrefix,
M_DoctorPrefix2,
M_DoctorName,
M_DoctorSuffix,
M_DoctorSuffix2,
M_DoctorGender,
M_DoctorDOB,
M_DoctorReligionCode,
M_DoctorReligionSystem,
M_DoctorBloodTypeCode,
M_DoctorBloodTypeSystem,
M_DoctorBloodRhCode,
M_DoctorBloodRhSystem,
M_DoctorEducationCode,
M_DoctorEducationSystem,
M_DoctorCitizenship,
M_DoctorEtnicCode,
M_DoctorEtnicSystem,
M_DoctorIdentifierCode,
M_DoctorIdentifierSystem,
M_DoctorIdentifierValue,
M_DoctorHp,
M_DoctorEmail,
M_DoctorM_SpecialistID,
M_DoctorAddress,
M_DoctorAddressRegionalCd,
M_DoctorAddressCity,
M_DoctorAddressDistrict,
M_DoctorAddressState,
M_DoctorAddressCountry,
M_DoctorIsActive,
M_DoctorCreatedUserID
)
VALUES
(
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?
)`
rst := dbx.Handlex.MustExec(query,
M_DoctorM_TitleID,
M_DoctorCode,
M_DoctorPrefix,
M_DoctorPrefix2,
M_DoctorName,
M_DoctorSuffix,
M_DoctorSuffix2,
M_DoctorGender,
M_DoctorDOB,
M_DoctorReligionCode,
M_DoctorReligionSystem,
M_DoctorBloodTypeCode,
M_DoctorBloodTypeSystem,
M_DoctorBloodRhCode,
M_DoctorBloodRhSystem,
M_DoctorEducationCode,
M_DoctorEducationSystem,
M_DoctorCitizenship,
M_DoctorEtnicCode,
M_DoctorEtnicSystem,
M_DoctorIdentifierCode,
M_DoctorIdentifierSystem,
M_DoctorIdentifierValue,
M_DoctorHp,
M_DoctorEmail,
M_DoctorS_SpecialistID,
M_DoctorAddress,
M_DoctorAddressRegionalCd,
M_DoctorAddressCity,
M_DoctorAddressDistrict,
M_DoctorAddressState,
M_DoctorAddressCountry,
"Y",
"1",
)
insertedID, err := rst.LastInsertId()
if err != nil {
defer logger.Sync()
logger.Error("Error Insert doctor",
zap.Any("object doctoraddv1", inp),
)
return data, fmt.Errorf("QUERY_FAILED LastInsertId")
}
s := strconv.Itoa(int(insertedID))
data, err = su.GetMdDoctorByID(s)
if err != nil {
defer logger.Sync()
logger.Error("Error get doctor by id",
// zap.Any("object doctoraddv1", inp),
zap.Any("ERROR MSG", err.Error()),
zap.Any("id last insert", s),
)
return data, fmt.Errorf("QUERY_FAILED GET DATA AFTER INSERT")
}
return data, nil
}

View File

@@ -104,11 +104,11 @@ templ MdDoctorScreen(
}
// for item dropdown sapaan
templ ItemDropdownSapaan(dataDropdown []models.TitleSapaan, selectedId int, defaultValueLabel string) {
templ ItemDropdownSapaan(dataDropdown []models.TitleSapaan, selectedId int) {
if len(dataDropdown) == 0 {
<option value="0" disabled selected>Tidak Ada Data</option>
} else {
<option value="default" selected>{ defaultValueLabel }</option>
// <option value="default" selected>{ defaultValueLabel }</option>
for _, v := range dataDropdown {
if (selectedId == v.M_TitleID) {
<option value={ strconv.Itoa(v.M_TitleID) } selected>{ v.M_TitleName }</option>
@@ -124,11 +124,11 @@ func ConcatValueTerminology(code string, codeSystem string) string {
}
// for item dropdown jenis kelamin
templ ItemDropdownJenisKelamin(dataDropdown []models.HardCodeDropdownV0, selectedId int, defaultValueLabel string) {
templ ItemDropdownJenisKelamin(dataDropdown []models.HardCodeDropdownJKV0, selectedId int) {
if len(dataDropdown) == 0 {
<option value="0" disabled selected>Tidak Ada Data</option>
} else {
<option value="default" selected>{ defaultValueLabel }</option>
// <option value="default" selected>{ defaultValueLabel }</option>
for _, v := range dataDropdown {
if (selectedId == v.ID) {
<option value={ strconv.Itoa(v.ID) } selected>{ v.Text }</option>
@@ -140,11 +140,11 @@ templ ItemDropdownJenisKelamin(dataDropdown []models.HardCodeDropdownV0, selecte
}
// for item dropdown terminology
templ ItemDropdownTerminology(dataDropdown []models.TerminologyV0, selectedItem models.TerminologySelectedV0, defaultValueLabel string) {
templ ItemDropdownTerminology(dataDropdown []models.TerminologyV0, selectedItem models.TerminologySelectedV0) {
if len(dataDropdown) == 0 {
<option value="0" disabled selected>Tidak Ada Data</option>
} else {
<option value="default" selected>{ defaultValueLabel }</option>
// <option value="default" selected>{ defaultValueLabel }</option>
for _, v := range dataDropdown {
if (selectedItem.CodeSystem == v.CodeSystem) && (selectedItem.AttributePath == v.AttributePath) && (selectedItem.Code == v.Code) {
<option value={ ConcatValueTerminology(v.Code, v.CodeSystem) } selected>{ v.Display }</option>
@@ -161,7 +161,7 @@ templ ItemRadioButtonKewarganegaraan(data []models.HardCodeRadioButtonV0, select
for _, v := range data {
if (selectedRadioButton == v.ID) {
<label style="display: flex; align-items: center; gap: 5px">
<input type="radio" name={ v.Name } value={ strconv.Itoa(v.ID) }/>
<input type="radio" name={ v.Name } value={ strconv.Itoa(v.ID) } checked/>
<p style="margin: 0">{ v.Text }</p>
</label>
} else {
@@ -175,11 +175,11 @@ templ ItemRadioButtonKewarganegaraan(data []models.HardCodeRadioButtonV0, select
}
// for item dropdown spesialis
templ ItemDropdownSpesialis(dataDropdown []models.SpecialistV0, selectedId int, defaultValueLabel string) {
templ ItemDropdownSpesialis(dataDropdown []models.SpecialistV0, selectedId int) {
if len(dataDropdown) == 0 {
<option value="0" disabled selected>Tidak Ada Data</option>
} else {
<option value="default" selected>{ defaultValueLabel }</option>
// <option value="default" selected>{ defaultValueLabel }</option>
for _, v := range dataDropdown {
if (selectedId == v.M_SpecialistID) {
<option value={ strconv.Itoa(v.M_SpecialistID) } selected>{ v.M_SpecialistName }</option>

View File

@@ -191,7 +191,7 @@ func MdDoctorScreen(
}
// for item dropdown sapaan
func ItemDropdownSapaan(dataDropdown []models.TitleSapaan, selectedId int, defaultValueLabel string) templ.Component {
func ItemDropdownSapaan(dataDropdown []models.TitleSapaan, selectedId int) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
@@ -210,35 +210,18 @@ func ItemDropdownSapaan(dataDropdown []models.TitleSapaan, selectedId int, defau
return templ_7745c5c3_Err
}
} else {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<option value=\"default\" selected>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(defaultValueLabel)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctor.templ`, Line: 111, Col: 54}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</option> ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, v := range dataDropdown {
if selectedId == v.M_TitleID {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<option value=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(v.M_TitleID))
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(v.M_TitleID))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctor.templ`, Line: 114, Col: 45}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -246,12 +229,12 @@ func ItemDropdownSapaan(dataDropdown []models.TitleSapaan, selectedId int, defau
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(v.M_TitleName)
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(v.M_TitleName)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctor.templ`, Line: 114, Col: 72}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -264,12 +247,12 @@ func ItemDropdownSapaan(dataDropdown []models.TitleSapaan, selectedId int, defau
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var8 string
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(v.M_TitleID))
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(v.M_TitleID))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctor.templ`, Line: 116, Col: 45}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -277,12 +260,12 @@ func ItemDropdownSapaan(dataDropdown []models.TitleSapaan, selectedId int, defau
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var9 string
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(v.M_TitleName)
var templ_7745c5c3_Var8 string
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(v.M_TitleName)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctor.templ`, Line: 116, Col: 63}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -305,7 +288,7 @@ func ConcatValueTerminology(code string, codeSystem string) string {
}
// for item dropdown jenis kelamin
func ItemDropdownJenisKelamin(dataDropdown []models.HardCodeDropdownV0, selectedId int, defaultValueLabel string) templ.Component {
func ItemDropdownJenisKelamin(dataDropdown []models.HardCodeDropdownJKV0, selectedId int) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
@@ -313,9 +296,9 @@ func ItemDropdownJenisKelamin(dataDropdown []models.HardCodeDropdownV0, selected
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var10 := templ.GetChildren(ctx)
if templ_7745c5c3_Var10 == nil {
templ_7745c5c3_Var10 = templ.NopComponent
templ_7745c5c3_Var9 := templ.GetChildren(ctx)
if templ_7745c5c3_Var9 == nil {
templ_7745c5c3_Var9 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
if len(dataDropdown) == 0 {
@@ -324,35 +307,18 @@ func ItemDropdownJenisKelamin(dataDropdown []models.HardCodeDropdownV0, selected
return templ_7745c5c3_Err
}
} else {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<option value=\"default\" selected>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var11 string
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(defaultValueLabel)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctor.templ`, Line: 131, Col: 54}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</option> ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, v := range dataDropdown {
if selectedId == v.ID {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<option value=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var12 string
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(v.ID))
var templ_7745c5c3_Var10 string
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(v.ID))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctor.templ`, Line: 134, Col: 38}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -360,12 +326,12 @@ func ItemDropdownJenisKelamin(dataDropdown []models.HardCodeDropdownV0, selected
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var13 string
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(v.Text)
var templ_7745c5c3_Var11 string
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(v.Text)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctor.templ`, Line: 134, Col: 58}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -378,12 +344,12 @@ func ItemDropdownJenisKelamin(dataDropdown []models.HardCodeDropdownV0, selected
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var14 string
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(v.ID))
var templ_7745c5c3_Var12 string
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(v.ID))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctor.templ`, Line: 136, Col: 38}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -391,12 +357,12 @@ func ItemDropdownJenisKelamin(dataDropdown []models.HardCodeDropdownV0, selected
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var15 string
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(v.Text)
var templ_7745c5c3_Var13 string
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(v.Text)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctor.templ`, Line: 136, Col: 49}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -415,7 +381,7 @@ func ItemDropdownJenisKelamin(dataDropdown []models.HardCodeDropdownV0, selected
}
// for item dropdown terminology
func ItemDropdownTerminology(dataDropdown []models.TerminologyV0, selectedItem models.TerminologySelectedV0, defaultValueLabel string) templ.Component {
func ItemDropdownTerminology(dataDropdown []models.TerminologyV0, selectedItem models.TerminologySelectedV0) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
@@ -423,9 +389,9 @@ func ItemDropdownTerminology(dataDropdown []models.TerminologyV0, selectedItem m
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var16 := templ.GetChildren(ctx)
if templ_7745c5c3_Var16 == nil {
templ_7745c5c3_Var16 = templ.NopComponent
templ_7745c5c3_Var14 := templ.GetChildren(ctx)
if templ_7745c5c3_Var14 == nil {
templ_7745c5c3_Var14 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
if len(dataDropdown) == 0 {
@@ -434,35 +400,18 @@ func ItemDropdownTerminology(dataDropdown []models.TerminologyV0, selectedItem m
return templ_7745c5c3_Err
}
} else {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<option value=\"default\" selected>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var17 string
templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(defaultValueLabel)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctor.templ`, Line: 147, Col: 54}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</option> ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, v := range dataDropdown {
if (selectedItem.CodeSystem == v.CodeSystem) && (selectedItem.AttributePath == v.AttributePath) && (selectedItem.Code == v.Code) {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<option value=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var18 string
templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(ConcatValueTerminology(v.Code, v.CodeSystem))
var templ_7745c5c3_Var15 string
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(ConcatValueTerminology(v.Code, v.CodeSystem))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctor.templ`, Line: 150, Col: 64}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -470,12 +419,12 @@ func ItemDropdownTerminology(dataDropdown []models.TerminologyV0, selectedItem m
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var19 string
templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(v.Display)
var templ_7745c5c3_Var16 string
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(v.Display)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctor.templ`, Line: 150, Col: 87}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -488,12 +437,12 @@ func ItemDropdownTerminology(dataDropdown []models.TerminologyV0, selectedItem m
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var20 string
templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(ConcatValueTerminology(v.Code, v.CodeSystem))
var templ_7745c5c3_Var17 string
templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(ConcatValueTerminology(v.Code, v.CodeSystem))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctor.templ`, Line: 152, Col: 64}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -501,12 +450,12 @@ func ItemDropdownTerminology(dataDropdown []models.TerminologyV0, selectedItem m
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var21 string
templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(v.Display)
var templ_7745c5c3_Var18 string
templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(v.Display)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctor.templ`, Line: 152, Col: 78}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -533,9 +482,9 @@ func ItemRadioButtonKewarganegaraan(data []models.HardCodeRadioButtonV0, selecte
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var22 := templ.GetChildren(ctx)
if templ_7745c5c3_Var22 == nil {
templ_7745c5c3_Var22 = templ.NopComponent
templ_7745c5c3_Var19 := templ.GetChildren(ctx)
if templ_7745c5c3_Var19 == nil {
templ_7745c5c3_Var19 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div style=\"display: flex; gap: 20px\" class=\"mt-6\">")
@@ -548,12 +497,12 @@ func ItemRadioButtonKewarganegaraan(data []models.HardCodeRadioButtonV0, selecte
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var23 string
templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(v.Name)
var templ_7745c5c3_Var20 string
templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(v.Name)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctor.templ`, Line: 164, Col: 38}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -561,25 +510,25 @@ func ItemRadioButtonKewarganegaraan(data []models.HardCodeRadioButtonV0, selecte
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var24 string
templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(v.ID))
var templ_7745c5c3_Var21 string
templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(v.ID))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctor.templ`, Line: 164, Col: 67}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var24))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"><p style=\"margin: 0\">")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" checked><p style=\"margin: 0\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var25 string
templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(v.Text)
var templ_7745c5c3_Var22 string
templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinStringErrs(v.Text)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctor.templ`, Line: 165, Col: 34}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var22))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -592,12 +541,12 @@ func ItemRadioButtonKewarganegaraan(data []models.HardCodeRadioButtonV0, selecte
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var26 string
templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(v.Name)
var templ_7745c5c3_Var23 string
templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(v.Name)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctor.templ`, Line: 169, Col: 38}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -605,12 +554,12 @@ func ItemRadioButtonKewarganegaraan(data []models.HardCodeRadioButtonV0, selecte
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var27 string
templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(v.ID))
var templ_7745c5c3_Var24 string
templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(v.ID))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctor.templ`, Line: 169, Col: 67}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var24))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -618,12 +567,12 @@ func ItemRadioButtonKewarganegaraan(data []models.HardCodeRadioButtonV0, selecte
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var28 string
templ_7745c5c3_Var28, templ_7745c5c3_Err = templ.JoinStringErrs(v.Text)
var templ_7745c5c3_Var25 string
templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(v.Text)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctor.templ`, Line: 170, Col: 34}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var28))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -645,7 +594,7 @@ func ItemRadioButtonKewarganegaraan(data []models.HardCodeRadioButtonV0, selecte
}
// for item dropdown spesialis
func ItemDropdownSpesialis(dataDropdown []models.SpecialistV0, selectedId int, defaultValueLabel string) templ.Component {
func ItemDropdownSpesialis(dataDropdown []models.SpecialistV0, selectedId int) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
@@ -653,9 +602,9 @@ func ItemDropdownSpesialis(dataDropdown []models.SpecialistV0, selectedId int, d
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var29 := templ.GetChildren(ctx)
if templ_7745c5c3_Var29 == nil {
templ_7745c5c3_Var29 = templ.NopComponent
templ_7745c5c3_Var26 := templ.GetChildren(ctx)
if templ_7745c5c3_Var26 == nil {
templ_7745c5c3_Var26 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
if len(dataDropdown) == 0 {
@@ -664,35 +613,18 @@ func ItemDropdownSpesialis(dataDropdown []models.SpecialistV0, selectedId int, d
return templ_7745c5c3_Err
}
} else {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<option value=\"default\" selected>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var30 string
templ_7745c5c3_Var30, templ_7745c5c3_Err = templ.JoinStringErrs(defaultValueLabel)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctor.templ`, Line: 182, Col: 54}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var30))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</option> ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, v := range dataDropdown {
if selectedId == v.M_SpecialistID {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<option value=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var31 string
templ_7745c5c3_Var31, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(v.M_SpecialistID))
var templ_7745c5c3_Var27 string
templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(v.M_SpecialistID))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctor.templ`, Line: 185, Col: 50}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var31))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -700,12 +632,12 @@ func ItemDropdownSpesialis(dataDropdown []models.SpecialistV0, selectedId int, d
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var32 string
templ_7745c5c3_Var32, templ_7745c5c3_Err = templ.JoinStringErrs(v.M_SpecialistName)
var templ_7745c5c3_Var28 string
templ_7745c5c3_Var28, templ_7745c5c3_Err = templ.JoinStringErrs(v.M_SpecialistName)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctor.templ`, Line: 185, Col: 82}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var32))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var28))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -718,12 +650,12 @@ func ItemDropdownSpesialis(dataDropdown []models.SpecialistV0, selectedId int, d
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var33 string
templ_7745c5c3_Var33, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(v.M_SpecialistID))
var templ_7745c5c3_Var29 string
templ_7745c5c3_Var29, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(v.M_SpecialistID))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctor.templ`, Line: 187, Col: 50}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var33))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var29))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -731,12 +663,12 @@ func ItemDropdownSpesialis(dataDropdown []models.SpecialistV0, selectedId int, d
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var34 string
templ_7745c5c3_Var34, templ_7745c5c3_Err = templ.JoinStringErrs(v.M_SpecialistName)
var templ_7745c5c3_Var30 string
templ_7745c5c3_Var30, templ_7745c5c3_Err = templ.JoinStringErrs(v.M_SpecialistName)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctor.templ`, Line: 187, Col: 73}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var34))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var30))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -763,9 +695,9 @@ func EmptyDiv1() templ.Component {
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var35 := templ.GetChildren(ctx)
if templ_7745c5c3_Var35 == nil {
templ_7745c5c3_Var35 = templ.NopComponent
templ_7745c5c3_Var31 := templ.GetChildren(ctx)
if templ_7745c5c3_Var31 == nil {
templ_7745c5c3_Var31 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div></div>")
@@ -787,9 +719,9 @@ func CssMdDoctor() templ.Component {
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var36 := templ.GetChildren(ctx)
if templ_7745c5c3_Var36 == nil {
templ_7745c5c3_Var36 = templ.NopComponent
templ_7745c5c3_Var32 := templ.GetChildren(ctx)
if templ_7745c5c3_Var32 == nil {
templ_7745c5c3_Var32 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<link rel=\"stylesheet\" href=\"assets/css/googlefont/poppins.css\"><link rel=\"stylesheet\" href=\"assets/css/googlefont/publicsans.css\"><link rel=\"stylesheet\" href=\"assets/css/googlefont/roboto.css\"><style>\r\n body {\r\n background-color: white;\r\n /* padding-right: 100px;\r\n padding-left: 100px; */\r\n }\r\n #div-chart {\r\n /* overflow-x: scroll; */\r\n margin: 40px 10vw 40px 10vw;\r\n }\r\n .title {\r\n font-size:20px;\r\n font-weight: bold;\r\n }\r\n #title {\r\n font-weight: 600;\r\n }\r\n .filter-option-inner-inner {\r\n\t\tmargin-top: 1.2vh;\r\n\t\tcolor: var(--text-disabled);\r\n\t}\r\n\t.bootstrap-select > .dropdown-toggle.bs-placeholder.btn {\r\n\t\tcolor: var(--text-disabled);\r\n\t}\r\n\r\n\t.bootstrap-select.btn-group .dropdown-menu {\r\n\t\tmin-width: 100%;\r\n\t\t-webkit-box-sizing: border-box;\r\n\t\t-moz-box-sizing: border-box;\r\n\t\tbox-sizing: border-box;\r\n\t\tposition: sticky;\r\n\t}\r\n\r\n\t.dropdown-menu {\r\n\t\ttransform: translate3d(0px, 0px, 0px) !important;\r\n\t}\r\n\r\n\tlabel.text-black {\r\n\t\tfont-size: smaller;\r\n\t}\r\n\r\n\t.customDP{\r\n\t\twidth: 100%;\r\n\t}\r\n\r\n\t.form-group{\r\n\t\twidth: 100%;\r\n\t}\r\n\r\n\r\n\t/* input::placeholder {\r\n\t\tfont-size: smaller;\r\n\t} */\r\n \r\n</style>")
@@ -811,9 +743,9 @@ func JsMdDoctor() templ.Component {
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var37 := templ.GetChildren(ctx)
if templ_7745c5c3_Var37 == nil {
templ_7745c5c3_Var37 = templ.NopComponent
templ_7745c5c3_Var33 := templ.GetChildren(ctx)
if templ_7745c5c3_Var33 == nil {
templ_7745c5c3_Var33 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<script>\r\n function onLoadingStart() {\r\n // const loadingParent = document.getElementById(\"loading-parent\");\r\n\t\t\t// const loadingChild = document.getElementById(\"loading-child\");\r\n\t\t\t// const loadingSpinner = document.getElementById(\"loading-spinner\");\r\n\r\n\t\t\t// loadingParent.classList.add(\"overlay\");\r\n\t\t\t// loadingParent.classList.add(\"overlay-block\");\r\n\t\t\t// loadingChild.classList.add(\"overlay-layer\");\r\n\t\t\t// loadingSpinner.classList.remove(\"d-none\");\r\n\r\n // Additional logic when loading starts\r\n }\r\n\r\n function onLoadingEnd() {\r\n console.log('Loading ended');\r\n // const loadingParent = document.getElementById(\"loading-parent\");\r\n\t\t\t// const loadingChild = document.getElementById(\"loading-child\");\r\n\t\t\t// const loadingSpinner = document.getElementById(\"loading-spinner\");\r\n\r\n\t\t\t// loadingParent.classList.remove(\"overlay\");\r\n\t\t\t// loadingParent.classList.remove(\"overlay-block\");\r\n\t\t\t// loadingChild.classList.remove(\"overlay-layer\");\r\n\t\t\t// loadingSpinner.classList.add(\"d-none\");\r\n }\r\n\r\n document.addEventListener('htmx:beforeRequest', function(event) {\r\n var indicator = document.querySelector('#loadingcontent');\r\n\t\t\tconsole.log(event.detail.xhr)\r\n\t\t\tconsole.log(event.detail.elt)\r\n if (indicator) {\r\n onLoadingStart();\r\n }\r\n });\r\n\r\n document.addEventListener('htmx:afterRequest', function(event) {\r\n var indicator = document.querySelector('#loadingcontent');\r\n if (indicator) {\r\n onLoadingEnd();\r\n }\r\n });\r\n </script>")
@@ -872,12 +804,12 @@ func ShowMdDoctorScreen(title string, cmp templ.Component, css templ.Component,
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var38 := templ.GetChildren(ctx)
if templ_7745c5c3_Var38 == nil {
templ_7745c5c3_Var38 = templ.NopComponent
templ_7745c5c3_Var34 := templ.GetChildren(ctx)
if templ_7745c5c3_Var34 == nil {
templ_7745c5c3_Var34 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
templ_7745c5c3_Var39 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Var35 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
@@ -892,7 +824,7 @@ func ShowMdDoctorScreen(title string, cmp templ.Component, css templ.Component,
}
return templ_7745c5c3_Err
})
templ_7745c5c3_Err = layout.CorporateLayout(title, css, js, navbarmenu, navbaruser, userprofile).Render(templ.WithChildren(ctx, templ_7745c5c3_Var39), templ_7745c5c3_Buffer)
templ_7745c5c3_Err = layout.CorporateLayout(title, css, js, navbarmenu, navbaruser, userprofile).Render(templ.WithChildren(ctx, templ_7745c5c3_Var35), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}

View File

@@ -319,12 +319,40 @@ templ BodyFormDoctor(
document.addEventListener('htmx:afterSwap', function(event) {
// Reinitialize selectpicker after HTMX content swap
$('.selectpicker').selectpicker('refresh');
document.getElementById('doctorimbuhantahun').setAttribute('readonly',true)
document.getElementById('doctorimbuhanbulan').setAttribute('readonly',true)
document.getElementById('doctorimbuhanhari').setAttribute('readonly',true)
// onchange date picker
var birthdateInput = document.querySelector("#doctorimbuhantanggallahir");
var invalidFeedback = birthdateInput.closest(".form-group").querySelector(".invalid-feedback");
var birthdateValue = birthdateInput.value;
var todayInput = document.querySelector("#doctortglnow");
birthdateInput.addEventListener('change', function() {
var birthdateValue = new Date(birthdateInput.value);
if (!isNaN(birthdateValue)) {
formatDate(todayInput.value, birthdateValue)
} else{
birthdateInput.classList.add('is-invalid');
invalidFeedback.textContent = 'Tanggal lahir tidak valid.';
}
})
var birthdateNowEdit = document.querySelector("#doctortgllahiredit");
if (birthdateNowEdit.value.trim() !== "") {
birthdateInput.value = birthdateNowEdit.value
formatDate(todayInput.value, new Date(birthdateInput.value))
}
});
document.addEventListener('DOMContentLoaded', function() {
document.getElementById('doctorimbuhantahun').setAttribute('disabled',true)
document.getElementById('doctorimbuhanbulan').setAttribute('disabled',true)
document.getElementById('doctorimbuhanhari').setAttribute('disabled',true)
document.getElementById('doctorimbuhantahun').setAttribute('readonly',true)
document.getElementById('doctorimbuhanbulan').setAttribute('readonly',true)
document.getElementById('doctorimbuhanhari').setAttribute('readonly',true)
// onchange date picker
var birthdateInput = document.querySelector("#doctorimbuhantanggallahir");

View File

@@ -478,7 +478,7 @@ func BodyFormDoctor(
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><!-- email --></div><!-- col 3 start --></div></div></div><script>\r\n\r\n\tfunction formatDate(todayInput, birthdateValue)\r\n\t{\r\n\t\tvar today = new Date(todayInput);\r\n\t\t\t\t\r\n\t\tvar years = today.getFullYear() - birthdateValue.getFullYear();\r\n\t\tvar months = today.getMonth() - birthdateValue.getMonth();\r\n\t\tvar days = today.getDate() - birthdateValue.getDate();\r\n\t\t\r\n\t\tif (days < 0) {\r\n\t\t\tmonths--;\r\n\t\t\tdays += new Date(today.getFullYear(), today.getMonth(), 0).getDate();\r\n\t\t}\r\n\t\t\r\n\t\tif (months < 0) {\r\n\t\t\tyears--;\r\n\t\t\tmonths += 12;\r\n\t\t}\r\n\r\n\t\tdocument.querySelector(\"[name='doctorimbuhantahun']\").value = years + ' Tahun';\r\n\t\tdocument.querySelector(\"[name='doctorimbuhanbulan']\").value = months + ' Bulan';\r\n\t\tdocument.querySelector(\"[name='doctorimbuhanhari']\").value = days + ' Hari';\r\n\t}\r\n\r\n document.addEventListener('htmx:afterSwap', function(event) {\r\n // Reinitialize selectpicker after HTMX content swap\r\n $('.selectpicker').selectpicker('refresh');\r\n });\r\n\r\n\tdocument.addEventListener('DOMContentLoaded', function() {\r\n\t\tdocument.getElementById('doctorimbuhantahun').setAttribute('disabled',true)\r\n\t\tdocument.getElementById('doctorimbuhanbulan').setAttribute('disabled',true)\r\n\t\tdocument.getElementById('doctorimbuhanhari').setAttribute('disabled',true)\r\n\r\n\t\t// onchange date picker\r\n\t\tvar birthdateInput = document.querySelector(\"#doctorimbuhantanggallahir\");\r\n \tvar invalidFeedback = birthdateInput.closest(\".form-group\").querySelector(\".invalid-feedback\");\r\n\r\n \tvar birthdateValue = birthdateInput.value;\r\n\r\n\t\tvar todayInput = document.querySelector(\"#doctortglnow\");\r\n\t\r\n\t\tbirthdateInput.addEventListener('change', function() {\r\n\t\t\tvar birthdateValue = new Date(birthdateInput.value);\r\n\t\t\tif (!isNaN(birthdateValue)) {\r\n\t\t\t\tformatDate(todayInput.value, birthdateValue)\r\n\t\t\t} else{\r\n\t\t\t\tbirthdateInput.classList.add('is-invalid');\r\n\t\t\t\tinvalidFeedback.textContent = 'Tanggal lahir tidak valid.';\r\n\t\t\t}\r\n\t\t})\r\n\r\n\t\tvar birthdateNowEdit = document.querySelector(\"#doctortgllahiredit\");\r\n\t\tif (birthdateNowEdit.value.trim() !== \"\") {\r\n\t\t\tbirthdateInput.value = birthdateNowEdit.value\r\n\t\t\tformatDate(todayInput.value, new Date(birthdateInput.value))\r\n\t\t}\r\n\t});\r\n </script>")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><!-- email --></div><!-- col 3 start --></div></div></div><script>\r\n\r\n\tfunction formatDate(todayInput, birthdateValue)\r\n\t{\r\n\t\tvar today = new Date(todayInput);\r\n\t\t\t\t\r\n\t\tvar years = today.getFullYear() - birthdateValue.getFullYear();\r\n\t\tvar months = today.getMonth() - birthdateValue.getMonth();\r\n\t\tvar days = today.getDate() - birthdateValue.getDate();\r\n\t\t\r\n\t\tif (days < 0) {\r\n\t\t\tmonths--;\r\n\t\t\tdays += new Date(today.getFullYear(), today.getMonth(), 0).getDate();\r\n\t\t}\r\n\t\t\r\n\t\tif (months < 0) {\r\n\t\t\tyears--;\r\n\t\t\tmonths += 12;\r\n\t\t}\r\n\r\n\t\tdocument.querySelector(\"[name='doctorimbuhantahun']\").value = years + ' Tahun';\r\n\t\tdocument.querySelector(\"[name='doctorimbuhanbulan']\").value = months + ' Bulan';\r\n\t\tdocument.querySelector(\"[name='doctorimbuhanhari']\").value = days + ' Hari';\r\n\t}\r\n\r\n document.addEventListener('htmx:afterSwap', function(event) {\r\n // Reinitialize selectpicker after HTMX content swap\r\n $('.selectpicker').selectpicker('refresh');\r\n\r\n\t\tdocument.getElementById('doctorimbuhantahun').setAttribute('readonly',true)\r\n\t\tdocument.getElementById('doctorimbuhanbulan').setAttribute('readonly',true)\r\n\t\tdocument.getElementById('doctorimbuhanhari').setAttribute('readonly',true)\r\n\r\n\t\t// onchange date picker\r\n\t\tvar birthdateInput = document.querySelector(\"#doctorimbuhantanggallahir\");\r\n \tvar invalidFeedback = birthdateInput.closest(\".form-group\").querySelector(\".invalid-feedback\");\r\n\r\n \tvar birthdateValue = birthdateInput.value;\r\n\r\n\t\tvar todayInput = document.querySelector(\"#doctortglnow\");\r\n\t\r\n\t\tbirthdateInput.addEventListener('change', function() {\r\n\t\t\tvar birthdateValue = new Date(birthdateInput.value);\r\n\t\t\tif (!isNaN(birthdateValue)) {\r\n\t\t\t\tformatDate(todayInput.value, birthdateValue)\r\n\t\t\t} else{\r\n\t\t\t\tbirthdateInput.classList.add('is-invalid');\r\n\t\t\t\tinvalidFeedback.textContent = 'Tanggal lahir tidak valid.';\r\n\t\t\t}\r\n\t\t})\r\n\r\n\t\tvar birthdateNowEdit = document.querySelector(\"#doctortgllahiredit\");\r\n\t\tif (birthdateNowEdit.value.trim() !== \"\") {\r\n\t\t\tbirthdateInput.value = birthdateNowEdit.value\r\n\t\t\tformatDate(todayInput.value, new Date(birthdateInput.value))\r\n\t\t}\r\n });\r\n\r\n\tdocument.addEventListener('DOMContentLoaded', function() {\r\n\t\tdocument.getElementById('doctorimbuhantahun').setAttribute('readonly',true)\r\n\t\tdocument.getElementById('doctorimbuhanbulan').setAttribute('readonly',true)\r\n\t\tdocument.getElementById('doctorimbuhanhari').setAttribute('readonly',true)\r\n\r\n\t\t// onchange date picker\r\n\t\tvar birthdateInput = document.querySelector(\"#doctorimbuhantanggallahir\");\r\n \tvar invalidFeedback = birthdateInput.closest(\".form-group\").querySelector(\".invalid-feedback\");\r\n\r\n \tvar birthdateValue = birthdateInput.value;\r\n\r\n\t\tvar todayInput = document.querySelector(\"#doctortglnow\");\r\n\t\r\n\t\tbirthdateInput.addEventListener('change', function() {\r\n\t\t\tvar birthdateValue = new Date(birthdateInput.value);\r\n\t\t\tif (!isNaN(birthdateValue)) {\r\n\t\t\t\tformatDate(todayInput.value, birthdateValue)\r\n\t\t\t} else{\r\n\t\t\t\tbirthdateInput.classList.add('is-invalid');\r\n\t\t\t\tinvalidFeedback.textContent = 'Tanggal lahir tidak valid.';\r\n\t\t\t}\r\n\t\t})\r\n\r\n\t\tvar birthdateNowEdit = document.querySelector(\"#doctortgllahiredit\");\r\n\t\tif (birthdateNowEdit.value.trim() !== \"\") {\r\n\t\t\tbirthdateInput.value = birthdateNowEdit.value\r\n\t\t\tformatDate(todayInput.value, new Date(birthdateInput.value))\r\n\t\t}\r\n\t});\r\n </script>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -558,7 +558,7 @@ func ActionFormDoctor(LinkClose string, targetClose string, hxSwapClose string,
var templ_7745c5c3_Var14 string
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(LinkClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctorformmodal.templ`, Line: 380, Col: 22}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctorformmodal.templ`, Line: 408, Col: 22}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
if templ_7745c5c3_Err != nil {
@@ -571,7 +571,7 @@ func ActionFormDoctor(LinkClose string, targetClose string, hxSwapClose string,
var templ_7745c5c3_Var15 string
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(targetClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctorformmodal.templ`, Line: 381, Col: 26}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctorformmodal.templ`, Line: 409, Col: 26}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
if templ_7745c5c3_Err != nil {
@@ -584,7 +584,7 @@ func ActionFormDoctor(LinkClose string, targetClose string, hxSwapClose string,
var templ_7745c5c3_Var16 string
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctorformmodal.templ`, Line: 382, Col: 24}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctorformmodal.templ`, Line: 410, Col: 24}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))
if templ_7745c5c3_Err != nil {
@@ -625,7 +625,7 @@ func BtnCloseFormDoctor(LinkClose string, targetClose string, hxSwapClose string
var templ_7745c5c3_Var18 string
templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(LinkClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctorformmodal.templ`, Line: 403, Col: 21}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctorformmodal.templ`, Line: 431, Col: 21}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18))
if templ_7745c5c3_Err != nil {
@@ -638,7 +638,7 @@ func BtnCloseFormDoctor(LinkClose string, targetClose string, hxSwapClose string
var templ_7745c5c3_Var19 string
templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(targetClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctorformmodal.templ`, Line: 404, Col: 25}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctorformmodal.templ`, Line: 432, Col: 25}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19))
if templ_7745c5c3_Err != nil {
@@ -651,7 +651,7 @@ func BtnCloseFormDoctor(LinkClose string, targetClose string, hxSwapClose string
var templ_7745c5c3_Var20 string
templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctorformmodal.templ`, Line: 405, Col: 23}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctorformmodal.templ`, Line: 433, Col: 23}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20))
if templ_7745c5c3_Err != nil {
@@ -706,7 +706,7 @@ func DeleteConfirmationBodyDoctor(inputId models.CustomTextFieldv2Prm,
var templ_7745c5c3_Var23 string
templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(componentID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctorformmodal.templ`, Line: 422, Col: 22}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctorformmodal.templ`, Line: 450, Col: 22}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23))
if templ_7745c5c3_Err != nil {
@@ -728,7 +728,7 @@ func DeleteConfirmationBodyDoctor(inputId models.CustomTextFieldv2Prm,
var templ_7745c5c3_Var25 string
templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(message)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctorformmodal.templ`, Line: 423, Col: 14}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctorformmodal.templ`, Line: 451, Col: 14}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25))
if templ_7745c5c3_Err != nil {
@@ -746,7 +746,7 @@ func DeleteConfirmationBodyDoctor(inputId models.CustomTextFieldv2Prm,
var templ_7745c5c3_Var26 string
templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(v)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctorformmodal.templ`, Line: 428, Col: 68}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctorformmodal.templ`, Line: 456, Col: 68}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26))
if templ_7745c5c3_Err != nil {
@@ -769,7 +769,7 @@ func DeleteConfirmationBodyDoctor(inputId models.CustomTextFieldv2Prm,
var templ_7745c5c3_Var27 string
templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(v)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctorformmodal.templ`, Line: 434, Col: 10}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctorformmodal.templ`, Line: 462, Col: 10}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27))
if templ_7745c5c3_Err != nil {
@@ -836,7 +836,7 @@ func ActionFormDoctorDelete(LinkClose string, targetClose string, hxSwapClose st
var templ_7745c5c3_Var30 string
templ_7745c5c3_Var30, templ_7745c5c3_Err = templ.JoinStringErrs(LinkClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctorformmodal.templ`, Line: 448, Col: 22}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctorformmodal.templ`, Line: 476, Col: 22}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var30))
if templ_7745c5c3_Err != nil {
@@ -849,7 +849,7 @@ func ActionFormDoctorDelete(LinkClose string, targetClose string, hxSwapClose st
var templ_7745c5c3_Var31 string
templ_7745c5c3_Var31, templ_7745c5c3_Err = templ.JoinStringErrs(targetClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctorformmodal.templ`, Line: 449, Col: 26}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctorformmodal.templ`, Line: 477, Col: 26}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var31))
if templ_7745c5c3_Err != nil {
@@ -862,7 +862,7 @@ func ActionFormDoctorDelete(LinkClose string, targetClose string, hxSwapClose st
var templ_7745c5c3_Var32 string
templ_7745c5c3_Var32, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctorformmodal.templ`, Line: 450, Col: 24}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctorformmodal.templ`, Line: 478, Col: 24}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var32))
if templ_7745c5c3_Err != nil {