33 lines
1.1 KiB
Go
33 lines
1.1 KiB
Go
package reference
|
|
|
|
import (
|
|
"fmt"
|
|
e "simrs-vx/internal/domain/bpjs-entities/reference"
|
|
ibpjs "simrs-vx/internal/infra/bpjs"
|
|
)
|
|
|
|
func endpointMapper(input *e.ReadListDto) string {
|
|
switch input.ReferenceType {
|
|
case e.RTProvince:
|
|
return ibpjs.O.BaseUrl + "provinces"
|
|
case e.RTCities:
|
|
return ibpjs.O.BaseUrl + "cities/" + input.PathValue1
|
|
case e.RTDistrict:
|
|
return ibpjs.O.BaseUrl + "districts/" + input.PathValue1
|
|
case e.RTDiagnose:
|
|
return ibpjs.O.BaseUrl + "diagnosa/" + input.PathValue1
|
|
case e.RTDiagnosePrb:
|
|
return ibpjs.O.BaseUrl + "diagnosaprb"
|
|
case e.RTMedicinePrb:
|
|
return ibpjs.O.BaseUrl + "obatprb/" + input.PathValue1
|
|
case e.RTUnit:
|
|
return ibpjs.O.BaseUrl + "referensi/poli/" + input.PathValue1
|
|
case e.RTHealthcare:
|
|
return fmt.Sprintf("%sreferensi/faskes?faskes=%s&jenis-faskes=%s", ibpjs.O.BaseUrl, input.PathValue1, input.PathValue2)
|
|
case e.RTDoctor:
|
|
return fmt.Sprintf("%sreferensi/dokter-dpjp?jenis-pelayanan=%s&tgl-pelayanan=%s&kode-spesialis=%s", ibpjs.O.BaseUrl, input.PathValue1, input.PathValue2, input.PathValue3)
|
|
default:
|
|
return ""
|
|
}
|
|
}
|