diff --git a/docker-compose.yaml b/docker-compose.yaml index 8599aa9..82a05df 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -16,7 +16,7 @@ services: container_name: okapi_wbx restart: always environment: - EXT_ADDR: "okapi_wbx:8888" + EXT_ADDR: "okapi_wbx" BIN_FOLDER: "/wbxbin" volumes: - "./wbx/data:/data" @@ -28,7 +28,7 @@ services: container_name: okapi_dvza restart: always environment: - EXT_ADDR: "okapi_dvza:9999" + EXT_ADDR: "okapi_dvza" volumes: - "./dvza/data:/data" - "./dvza/certs:/certs" diff --git a/dvzaservice/main.go b/dvzaservice/main.go index cc79e20..7470d2f 100644 --- a/dvzaservice/main.go +++ b/dvzaservice/main.go @@ -16,7 +16,9 @@ import ( "src.whiteboxsystems.nl/DECOZO/okapidemo/certgen" ) -var rpcAddr = "0.0.0.0:9999" +var rpcPort = "9999" +var rpcAddr = "0.0.0.0:" + rpcPort +var extRpcAddr = "localhost:" + rpcPort var uiAddr = "0.0.0.0:9095" func loadCert() *tls.Certificate { @@ -84,6 +86,10 @@ func main() { grpcServer := grpc.NewServer(opts...) + if ext := os.Getenv("EXT_ADDR"); ext != "" { + extRpcAddr = ext + ":" + rpcPort + } + go func() { lis, err := net.Listen("tcp", rpcAddr) if err != nil { diff --git a/dvzaservice/srv.go b/dvzaservice/srv.go index 965a7c5..bf90d0f 100644 --- a/dvzaservice/srv.go +++ b/dvzaservice/srv.go @@ -69,7 +69,8 @@ func (srv *UIService) init() { } func (srv *UIService) GetIndex(c *gin.Context) { - c.HTML(http.StatusOK, "index.html", gin.H{}) + + c.HTML(http.StatusOK, "index.html", gin.H{"externalURL": extRpcAddr}) } func (srv *UIService) GetConnection(c *gin.Context) { diff --git a/dvzaservice/templates/index.html b/dvzaservice/templates/index.html index fc152cb..b836893 100644 --- a/dvzaservice/templates/index.html +++ b/dvzaservice/templates/index.html @@ -8,6 +8,7 @@
+ \ No newline at end of file diff --git a/whiteboxservice/app/src/Home.js b/whiteboxservice/app/src/Home.js index 590461f..d61739d 100644 --- a/whiteboxservice/app/src/Home.js +++ b/whiteboxservice/app/src/Home.js @@ -5,7 +5,7 @@ const App = () => { return (

Welkom bij Whitebox

-

Dit systeem is beschikbaar op: wbx.openkv.mcsr.nl:8888

+

Dit systeem is beschikbaar op: {window.externalUrl}

); }; diff --git a/whiteboxservice/bin/template.html b/whiteboxservice/bin/template.html deleted file mode 100644 index b0754dd..0000000 --- a/whiteboxservice/bin/template.html +++ /dev/null @@ -1,442 +0,0 @@ - - -
- -{{define "person-row"}} - - {{if .Name}}{{.Name}}{{else}}Geen naam{{end}} - {{.Function}} - {{.Address}} - {{if .AGB}}AGB: {{.AGB}}{{end}} - {{end}} - -{{define "medi-group-epi"}} - {{$root := .}} - - - - - - - - {{if eq .Extra.verbose_icpc_description "true"}} - - {{else}} - {{end}} - - - - - {{range .Episodes}} - - - - - - {{if eq $root.Extra.verbose_icpc_description "true"}} - - - {{else}} - {{if eq .Description ""}} - - {{else}} - - {{end}} - {{end}} - {{end}} - -
DatumTypeICPCBeschrijvingBeschrijving arts
{{.Date}}{{.Type}}{{.ICPC}}{{.Title}}{{.Description}}{{.Title}}{{.Description}}
- {{end}} - -{{define "medi-group-ica"}} - {{$root := .}} - - - - - - - - {{if eq $root.Extra.verbose_icpc_description "true"}} - - {{else}} - {{end}} - - - - {{range .Indicators}} - - - - - - {{if eq $root.Extra.verbose_icpc_description "true"}} - - {{else}} - - {{end}} - {{end}} - -
DatumTypeICPCBeschrijving
{{.Date}}{{.Type}}{{.ICPC}}{{.Title}}{{.Description}}
- {{end}} - -
-

Huisarts

- - {{template "person-row" .GP}} - {{if .Pharmacy.Anchor}}{{template "person-row" .Pharmacy}}{{end}} -
- -{{if .Practitioners}} -

Medebehandelaren

-
- {{range .Practitioners}} - {{template "person-row" .}}{{end}} -
-
-{{end}} - -
- -
-

Patiënt

- - - - - - - - -
Naam: - {{.Patient.Name}} - {{if .Patient.BSN}} -
BSN: - {{.Patient.BSN}} - {{end}} -
Geboortedatum: - {{.Patient.Birthdate}} -
Adres: - {{.Patient.Address}} -
Geslacht: - {{.Patient.Gender}} - {{range .Patient.OtherFields}} -
{{.Key}}: - {{.Value}} - {{end}} -
-
- -{{if .Memo}} -
-

Memo

- {{.Memo}} -
-{{end}} - -{{if .Episodes}} -
-

Episodelijst

-{{template "medi-group-epi" .}} -
-{{end}} - -{{if .Indicators}} -
-

Contra-indicaties, interacties en allergieën

-{{template "medi-group-ica" .}} -
-{{end}} - -{{if .Medication}} -
-

Medicatieoverzicht

- - - - - - - - - - - - {{range $index, $med := .Medication}} - {{if gt (len $med.Fold) 1}} - - - - - - - - {{range $fold := $med.Fold}} - - - - - - - - {{end}} - {{else}} - - - - - - - - {{end}} - {{end }} - -
ReceptGebruiksvoorschriftHoeveelheidIngangVervalt
{{$med.Recipe}}{{$med.Instructions}}{{ YieldDosage $med }}{{$med.StartDate}}{{$med.EndDate}}
{{ if ne $med.Instructions $fold.Instructions}}{{$fold.Instructions}}{{else}}{{end}}{{ YieldDosage $fold }}{{$fold.StartDate}}{{$fold.EndDate}}
{{$med.Recipe}}{{$med.Instructions}}{{ YieldDosage $med }}{{$med.StartDate}}{{$med.EndDate}}
-
-{{end}} - -{{if .Journal}} -
-

Journaal

-
- -{{range .Journal}} -
-
{{.Date}}
-
- - {{if .Results}} -
- - - - - - - - - - {{range .Results}} - - - - - {{end}} - -
IdentificatieResultaatBeschrijving
{{.Kind}}{{.Result}}{{if eq .Identification "Buiten normaalwaarde"}}{{.Identification}}{{else}}{{.Identification}}{{end}} - {{if and .Identification .Description}}
{{end}} - {{.Description}} -
-
- {{end}} - - {{range .Lines}} -
- - - - {{if .SOEP}} - -
{{.SOEP}}: - {{ConvertLinebreaks .Text}} - {{end}} - {{if .Kind}} - {{.Kind}}{{if .Text}}:{{end}} - {{ConvertLinebreaks .Text}} - {{end}} -
- -
- {{end}} -
-
-{{end}} -{{end}} - -{{if .Extra.csrf_token }} -
-
- -

- - -
-{{end}} - -
- diff --git a/whiteboxservice/main.go b/whiteboxservice/main.go index d80a302..7e932b8 100644 --- a/whiteboxservice/main.go +++ b/whiteboxservice/main.go @@ -16,9 +16,10 @@ import ( "src.whiteboxsystems.nl/DECOZO/okapidemo/certgen" ) -var srvaddr = "0.0.0.0:8888" +var rpcPort = "8888" +var srvaddr = "0.0.0.0:" + rpcPort +var extRpcAddr = "localhost:" + rpcPort var patientIf = "0.0.0.0:8085" -var binFolder = "./bin" func loadCert() *tls.Certificate { _, err := os.Stat("certs/client.crt") @@ -71,6 +72,9 @@ func main() { binFolder = os.Getenv("BIN_FOLDER") } + if ext := os.Getenv("EXT_ADDR"); ext != "" { + extRpcAddr = ext + ":" + rpcPort + } openapisrv := NewServer() openapisrv.LoadData("./data/data.db") opts := []grpc.ServerOption{ diff --git a/whiteboxservice/srv.go b/whiteboxservice/srv.go index ae3a88f..b1cc88d 100644 --- a/whiteboxservice/srv.go +++ b/whiteboxservice/srv.go @@ -70,7 +70,7 @@ func (srv *UIService) init() { } func (srv *UIService) GetIndex(c *gin.Context) { - c.HTML(http.StatusOK, "index.html", gin.H{}) + c.HTML(http.StatusOK, "index.html", gin.H{"externalURL": extRpcAddr}) } func (srv *UIService) GetConnection(c *gin.Context) { diff --git a/whiteboxservice/templates/index.html b/whiteboxservice/templates/index.html index f14b318..334204b 100644 --- a/whiteboxservice/templates/index.html +++ b/whiteboxservice/templates/index.html @@ -8,6 +8,7 @@
+ \ No newline at end of file